OleDbParameter question

  • Thread starter Thread starter Richard L Rosenheim
  • Start date Start date
R

Richard L Rosenheim

I'm writing an OleDbParameter statement as part of an UpdateCommand. Couple
quick questions:

1) I'm using an Access/Jet database with a field of type "Date". Would
System.Data.OleDb.OleDbType.DBTimeStamp be the correct data type to specify?

2) What would the size of the field of the field be? It should be in
the MSDN documentation, but I wasn't able to find it.

TIA,

Richard Rosenheim
 
No if it's Date in the DB. You can also use DBDate
System.Data.OleDb.OleDbType.Date()
If you need it to behave like a DateTimeStamp, you can use
the Now but remember that it might be skewed if the client
machine has a different clock time than the server machine.

Not sure about the Size though....

Good Luck,

Bill
 
DateTime fields are 8 bytes.

I couldn't find anything on MSDN either (I know for a
fact that it WAS there, but who knows what's happened to
it). Here's a link to a PDF file showing some of the
data types and their size in bytes:

www.cs.kau.se/cs/education/courses/davb04/lectures/IntroSQ
L.pdf

Using ADO 2.8 or eariler, you could also make a little
table in an Access database with fields of every data
type, then just iterate through the recordset.fields
object and print out the definedsize property, but I'm
not sure if there are any comparable objects/properties
in ADO.NET.

Hope this helps.

Paul K
 
Back
Top