Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Oracle VB.NET
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
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
Edited 12-Feb-12 20:34pm
Mehdi Gholam233.5K
v2

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 375
1 _Amy 235
2 Andreas Gieriet 180
3 Peter Leow 175
4 Dave Kreskowiak 155
0 OriginalGriff 7,540
1 Sergey Alexandrovich Kryukov 6,462
2 Maciej Los 3,849
3 Peter Leow 3,653
4 CHill60 2,712


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 13 Feb 2012
Copyright © CodeProject, 1999-2014
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