Click here to Skip to main content
15,880,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 vb.net statement is
VB
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
Updated 12-Feb-12 20:34pm
v2

1 solution

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900