Click here to Skip to main content
13,151,141 members (45,008 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Respected sir/mam

I want to store a date and time in oracle 10g database.
I am trying to inserting a date and time and my statement is
dsNewRow.Item("date_time") = Format(DateTime.Today, ("yyyy-MM-dd HH:mm:ss.000"))

in the above statement only date is inserting in database. But i want to inserting date as well as time. My date_time fields data type is date.
how it is possible?

Please help me.

Thank You in advance.
Posted 12-Feb-12 20:22pm
Updated 12-Feb-12 20:34pm
Mehdi Gholam344.2K

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I remember, that Oracle "can" handle DateType field values as string. If you write a query the date has to be given as string in the where-clause:

Select * From Employee Where HireDate >= '01-01-2011 00:00:00'

So, it is correct that you put a string value.

Furthermore, you can use the OracleDateTime structure from the Oracle-Namespace when you use the drivers from Oracle and not from Microsoft.

Using the Oracle drivers from Microsoft is not recommended.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170924.2 | Last Updated 13 Feb 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100