473,834 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

oleDbDeleteComm and1.Parameters .Add(new
System.Data.Ole Db.OleDbParamet er("DepartureTi me",
System.Data.Ole Db.OleDbType.DB Date...

to

oleDbDeleteComm and1.Parameters .Add(new
System.Data.Ole Db.OleDbParamet er("DepartureTi me",
System.Data.Ole Db.OleDbType.DB Time...

but it doesn't work.

Anybody can help? Thanks.

Regards
nb
Mar 21 '06 #1
1 4727
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.sin gnet.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

oleDbDeleteComm and1.Parameters .Add(new
System.Data.Ole Db.OleDbParamet er("DepartureTi me",
System.Data.Ole Db.OleDbType.DB Date...

to

oleDbDeleteComm and1.Parameters .Add(new
System.Data.Ole Db.OleDbParamet er("DepartureTi me",
System.Data.Ole Db.OleDbType.DB Time...

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
7833
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 the issue. I hope I've included all relevant information. On a form, I have a DateTimePicker with the following
2
17363
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 (update, append) should be activated in order to transfer data to other tables. I tried to avoid any coding in VB, as I am not a professional, but I have found a statement in an article, that, unlike select queries, form's Input Property can't be...
0
1322
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
2715
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 guess this may be due to precision, or imprecision, of the value stored in a date field. IOW, date/time fields are accurate to the second but may or may not be accurate if you add or subtract some time from it. If you have an idea why the...
2
16364
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 DataFormatString is set to "{0:d}" in order to display the date in short date format (without the time). But the DataFormatString doesn't seem to have any effect. The DateTime gets displayed with the time. I have another GridView that is bound...
1
3730
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 an alternative to the mentalis.org's IniReader, I submit the following files to the web news group DBs...: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2
13269
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 string myTime = "13:30"; elena
3
2236
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 dates that are in the database (formatted as above), isolate the date (which is in short format) and compare it to the short formatted date in a datetimepicker.
2
3055
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. eg. 16.11.2007 --short date and convert that to DateTime. After conversion it looks like 16.11.2007 0:00:00 How I can get short date like 16.11.2007 without 0:00:00 after
2
1661
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() + DateTime.Now.ToShortTimeString().ToString(); string logName = Data.Name + Data.ProductName + logDateExtention; And this throws exception during the debug that the name is not legal
0
9797
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10509
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10219
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6954
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5626
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5793
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.