G
Guest
I'm writing data to an Access database using OleDb stuff. Everything works
fine except when I'm working with dates. Here's what happens:
If I write UPDATE SQL with an "@SomeDateTime" parameter and then I create an
OleDbParameter object and I set it's Name field to @SomeDateTime and it's
Value field to a value of type DateTime, and then finally, create an
OleDbCommand with the SQL and then do a Cmd.Parameters.Add() with my
@SomeDateTime Parameter object, I get a runtime error.
So someone told me to change the Parameter.DbType so that it is
"MyParam.DbType = DbType.Date;". When I do this, the error goes away. BUT
HERE's THE PROBLEM: When I do this, the date that is written to my database
is only the DATE portion without the TIME!
How do I get the full Date-Time to be stored???
Thanks.
Alex
fine except when I'm working with dates. Here's what happens:
If I write UPDATE SQL with an "@SomeDateTime" parameter and then I create an
OleDbParameter object and I set it's Name field to @SomeDateTime and it's
Value field to a value of type DateTime, and then finally, create an
OleDbCommand with the SQL and then do a Cmd.Parameters.Add() with my
@SomeDateTime Parameter object, I get a runtime error.
So someone told me to change the Parameter.DbType so that it is
"MyParam.DbType = DbType.Date;". When I do this, the error goes away. BUT
HERE's THE PROBLEM: When I do this, the date that is written to my database
is only the DATE portion without the TIME!
How do I get the full Date-Time to be stored???
Thanks.
Alex