|
How do I add a timestamp to SQL db?? I am using CDatabase and CRecordSet.
Thanks,
grahamoj.
|
|
|
|
|
Hi,
Can anyone let me know if the usage of typed datasets in ADO.NET has any serious limitations compared to untyped datasets ?
Thanks in advance,
Kanchana
|
|
|
|
|
Usually it's untyped datasets that are considered more limited than typed ones, unless you are accessing data you know little about. However, it really depends on what you want to do.
Typed datasets essentially just means the types are known and understood, whereas untyped ones are generic, and hence less is known (and needs to be known). Typed sets are much more efficient, since more work is done at compile time than at runtime. Also, typed sets can do more error checking to avoid mistakes. Commonly, the goal is to use typed sets whenever possible.
Untyped sets can be a little simpler at first, since less needs to be specified, column names do not need to be known, etc. If you do need to work with untyped sets at some point, it's useful if you can have a schema automatically generated, so you can move to typed sets. That will depend on the situation, though.
If you do not consider needing to know what types to deal with to be a problem, then I cannot think of any serious limitations with typed datasets.
Cheers
|
|
|
|
|
I need each param parsed out of this string. I am having trouble parsing if the vars vary in length.
Data: ec=TTT&oc=CRM&tot=501&UID=88997
<br />
(SELECT<br />
ID, IP, TID, TheUserDetails.UserID as UserID, <br />
--Parsing<br />
Querystring,<br />
SUBSTRING(Querystring, CHARINDEX('ec=',Querystring) + 3, CHARINDEX('&', Querystring) - 4) as EC,<br />
SUBSTRING(Querystring, CHARINDEX('oc=',Querystring) + 3, CHARINDEX('&', Querystring) - 4) as OC,<br />
SUBSTRING(Querystring, CHARINDEX('tot=',Querystring) + 4, CHARINDEX('&', Querystring) - 5) as TOT,<br />
SUBSTRING(Querystring, CHARINDEX('uid=',Querystring) + 4, 50) as UID<br />
FROM WebLog l LEFT JOIN<br />
dbo.TheUserDetails ON <br />
l.TID = TheUserDetails.TrackID)<br />
Alex Polajenko
|
|
|
|
|
Alex
If the parameters are always in the same order then couldn't you use something like:
SUBSTRING(Querystring,<br />
CHARINDEX('ec=',Querystring) + 3,<br />
CHARINDEX('&oc=', Querystring) - (CHARINDEX('ec=',Querystring) + 3)<br />
) as EC
The third argument for SubString calculates the size by finding the difference between the starting position of "oc=" and "ec=". Note that I haven't tried this because I'm at a client's site today.
Good luck
Andy Harman
|
|
|
|
|
Hi,
I have a datagrid bound to a dadaset table. I programatically added a new row. I wonder what is the easiest way to make the current cell or row to the newly added row in the datagrid?
Thanks.
Dion
|
|
|
|
|
DataGrid::CurrentRowIndex and myDataGrid::CurrentCell
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hi guys.
This is the problem I encountered. If anybody has any ideas about this, please get back to me. Thanks in advance.
So, I have like 12.000 records in access, and since it is growing fadtla, I upsized it to SQL server. Now, Access provides a native support for OLE bound object, which is not the casew with SQL server. I have Excel and Word files embedded in Access fields, now when I upsized it to SQL server it converts it to Image data type. I know, there is also na option to save a path to the file, and keep file on a disk, but there are security issues related to that so it nees to stay in the dbs.
The problem is when I open ADO stream object, read a binary content from the filed, save it to the disk and opne it, in Excel for instance, it gives me a lot of corrupted data, when some of it is actually displayed correctly. Now it seems as it gets corrupted when upsizing from Access for Access probably does not keep data as it is, i.e. a binary image of the file, but also puts some wrapper around it to support different OLE features and office automation (when you click the OLE bound field in the access, it automatically opens the Word or Excel app and file in it).
So what would be the way for working around this? I can manually open each file in Access and save it to the disk and then upload it from there to SQL server, which will work (I tried it) but there is just to much of it. Is there any way of getting a clear binary stream out of the access or sql server?
Anyways, your ideas are greatly appreciated.
Thanks,
Mirano
.
|
|
|
|
|
You are right. Access uses OleSaveToStream and OleLoadFromStream COM API calls to save/load objects. The CLSID of the stored object is stored prior to object's binary data.
The best solution I may recommend. Don't modify the data transferred from Access. If you are programming in C++ just pass the stream object to OleLoadFromStream function and it will do all job for you. If you are developing under VB, save stream to disk and use GetObject("pathname"), the object will be loaded automatically.
|
|
|
|
|
I am new to database programming and am relatively ineperienced in C++ programming (have done most of my programming in Java). I have searched and searched for tutorials on how to do what I want to do and have had little luck. All I need to do is to read from a .dbf file that contains information about airports. This dbf file is stored locally on this PC and the PC runs Windows 2000. I need to develop a program that I can run on a number of different PC's running Windows 2000, each having it's own locally stored .dbf file. When I research database resources, I see ADO, DAO, ODBC, OLE DB etc... etc... and I cant seem to make any sense of any of it. I was wondering if some of you could help.
1) How should I get started? What class should I use?
2) Do you have any weblinks of some very simple to the point online tutorials that can help me along.
Any help would be appreciated
thanks
Kevin Shaffer
Student of Computer Science
University of Kansas
kshaff03@msn.com
|
|
|
|
|
|
|
I think it is the maximum byte size of the field.
Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 Blackadder: Baldrick, have you no idea what irony is? Baldrick: Yeah, it's like goldy and bronzy only it's made of iron.
|
|
|
|
|
Bruce Duncan wrote:
maximum byte size
Ok cool. I thought that's what it might be.
How would I determine the maximum amount of characters that can be stored in an nvarchar field, say of length 64?
Thanks
$TeVe McLeNiThAn
|
|
|
|
|
A thought crossed my mind just as I posted my previous answer...
In Enterprise Manager, when you have an nvarchar type, with a length of 50, it means it can store 50 unicode characters, and therefore take up a maximum of 100 bytes. Hence, my previous answer is not entirely correct.
To answer your new question, an nvarchar field of length 64 can hold up to 64 unicode character, with a byte size of up to 128 (+ minimal overhead I guess)
Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 Blackadder: Baldrick, have you no idea what irony is? Baldrick: Yeah, it's like goldy and bronzy only it's made of iron.
|
|
|
|
|
Thanks. That helps.... I didn't want to make fields too short nor too big;)
$TeVe McLeNiThAn
|
|
|
|
|
Cheers, glad to help
Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 Blackadder: Baldrick, have you no idea what irony is? Baldrick: Yeah, it's like goldy and bronzy only it's made of iron.
|
|
|
|
|
I have a situation whereby I need to modify a base query with an unknown number of additional restraints which are themselves held in a reference table. How would I go about this?
For example the reference table might hold:
"user_name <> 'default'"
"policy_no > 20000"
etc.
and my stored proc needs to add these conditions to its select operation. Ideas?
'--8<------------------------
Ex. Datis:
Duncan Jones
http://www.merrioncomputing.com
|
|
|
|
|
I'm assuming you're using SQL Server.
Look up the sp_executesql system stored proc or the EXECUTE ( ) statement, both will let you execute a statement contained within a varchar variable.
Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 Blackadder: Baldrick, have you no idea what irony is? Baldrick: Yeah, it's like goldy and bronzy only it's made of iron.
|
|
|
|
|
I'm using Sybase XI - but I'm sure there's an equivalent somewhere - but that'd mean I'd have to assemple the entire query as a varchar().
'--8<------------------------
Ex. Datis:
Duncan Jones
http://www.merrioncomputing.com
|
|
|
|
|
Sorry, don't know anything about Sybase, but I would imagine it has something similar.
Maybe this is what you're looking for ?
How can I execute dynamic SQL with ASE?[^]
Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 Blackadder: Baldrick, have you no idea what irony is? Baldrick: Yeah, it's like goldy and bronzy only it's made of iron.
|
|
|
|
|
Okay... c# winforms ado.net
Can i size up columns using the resource editor thing?
Ahead of time before the app starts and forces the user
to resize all the columns each time?
And how do I hide a column?
Thanks.
...Steve
|
|
|
|
|
Dear friends,
I have an application developed in VC++ and it makes an active connection to SQL server using ADO. My application issues queries and in return SQL server sends me results.
Is it possible that SQL server 'talk to my application' i.e what i want is that whenever any row of a table is changed in SQL server by some other entity, SQL server inform my application of this change. Is it possible??
|
|
|
|
|
Hi..
Seems you need to create a trigger in SQL Server that call an Extended Stored Procedure (made in vc++ for example)
this Stored Procedure can store a shared variable that your Application checks for it..
You can create a worker thread that is blocked until this variable changes and unlocked by the Extended Stored Procedure...
Anyway .. I love the idea of making SQL server talks to your Application..
tell us about any progress
|
|
|
|
|
I'm new to c#, winforms and ado.net, so bear with me.
I've got a dumb lil checkbook table. I don't WANT to have an identity
column for a primary key, but i do to help out ado.net...
So I get SqlConnection, DataSet, and SqlDataAdapter's Fill/Update.
I haven't really messed much with the DataGrid, but got somethin goin on.
And I need help with the properties of this frassin brassin adapter.
I've been thru the adapter wizard, but hate the mess it leaves.
I know about the commandbuilder a bit, but don't know when it's needed
and when not.
1) c# to hide the dang identity column in my datagrid is?
2) can I lose the identity column? implications are?
3) What's the deal with the SqlDataAdapter properties???
I guess tackin on a CommandBuilder is easiest, but you gotta have
a single primary key, right?
Otherwise, what do I do to fill in the sel/ins/upd/del command props?
Thanks VERY much for ANY help
...Steve
|
|
|
|
|