By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,095 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

MS Access Datetime (Short time) -> DBDate

P: n/a
nb
Hi

I am using Ole Db to get data from MS Access into my C# windows application.
In the database file, there is a column with datatype 'Datetime' and format
'Short Time'. However, in my C# application, it is displayed as a date.

I tried changing

oleDbDeleteCommand1.Parameters.Add(new
System.Data.OleDb.OleDbParameter("DepartureTime",
System.Data.OleDb.OleDbType.DBDate...

to

oleDbDeleteCommand1.Parameters.Add(new
System.Data.OleDb.OleDbParameter("DepartureTime",
System.Data.OleDb.OleDbType.DBTime...

but it doesn't work.

Anybody can help? Thanks.

Regards
nb
Mar 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
There is no Time class in .Net, only DateTime. The time is in there. Just
extract it from the date.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"nb" <re**************@yahoo.com> wrote in message
news:dv**********@reader01.singnet.com.sg...
Hi

I am using Ole Db to get data from MS Access into my C# windows
application. In the database file, there is a column with datatype
'Datetime' and format 'Short Time'. However, in my C# application, it is
displayed as a date.

I tried changing

oleDbDeleteCommand1.Parameters.Add(new
System.Data.OleDb.OleDbParameter("DepartureTime",
System.Data.OleDb.OleDbType.DBDate...

to

oleDbDeleteCommand1.Parameters.Add(new
System.Data.OleDb.OleDbParameter("DepartureTime",
System.Data.OleDb.OleDbType.DBTime...

but it doesn't work.

Anybody can help? Thanks.

Regards
nb

Mar 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.