MS Access Datetime (Short time) -> DBDate

  • Thread starter Thread starter nb
  • Start date Start date
N

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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top