473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

MS Access Datetime (Short time) -> DBDate

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
1 4683
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jay | last post by:
I previously posted this question under Visual Basic newsgroup, but was advised to re-post here. I'm hoping someone can help me solve an issue I'm having with VB.Net and Access 2000. Here's...
2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
0
by: loyalone | last post by:
q: how can I format data that saved and updated as short time into access database from vb I tried but always saved time as blank or datetime
5
by: Salad | last post by:
I wrote a routine for somebody yesterday. When I compare datStart to datEnd in the DoWhile comamnd, when the date/times match they don't. For example, 1:00:00 PM does not match 1:00:00 PM. I...
2
by: Rob Roberts | last post by:
I have a GridView that is bound to a collection of DateTimes (i.e. - Collection<DateTime>). I have a BoundField in the GridView, and its DataField is set to the DateTime's Date property, and the...
1
by: lactaseman | last post by:
While I know this is not the correct venue... I realize this is of little to no importance to most out there... however, if I had found this in my initial searches, I would have used this. So, as...
2
by: elena | last post by:
Hi, All Please, i need help with cast string to DateTime: DateTime dt = new DateTime(2006,09,17); it works i can update Field in Access DB Next field is Short Time data type, how i can cast...
3
by: Matt Brown - identify | last post by:
Hello, I'm trying to figure out a method to look up by a range of dates, entries in a database. The format of the date in the database is "M\D \yyyy HH:MM:SS". What i need to do is take the...
2
by: Mike | last post by:
Hi, I have DateTime filed in db table. I'd like to search my db based on DateTime filed, actually to list all rows with particular date, for e.g. 16.11.2007... I send string to method for....
2
by: csharpula csharp | last post by:
Hello, I am trying to add Date and Current time to a name of a log file. I tried doing this: string logDateExtention = DateTime.Now.ToShortDateString().ToString() +...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.