The string was not recognized as a valid datetime

The string was not recognized as a valid datetime

Postby rmascaya » Wed 25 Oct 2006 01:35

I would like to comunicate my application with a store procedure.
That store procedure have a Date Type field named Init_Dat.

I tried put in the value:

TO_DATE('19-08-2006 10:15:00', 'DD-MM-YYYY HH24:MI:SS'),

and when I put Fill over selected DataSet, I get the follow message:
"The string was not recognized as a valid datetime. There is a unknown word starting at index 0"

How I can resolve my problem?
rmascaya
 
Posts: 4
Joined: Sat 12 Aug 2006 06:16

Postby Paul » Wed 25 Oct 2006 06:52

Can you provide some code to demonstrate what you do to pass this parameter to stored procedure.
What is a type of parameter? (OracleParameter.OracleDbType = ?)
What is a value of parameter? (OracleParameter.Value = ?)
What is type of parameter in stored procedure declaration?

String with function calls (with TO_DATE) is not a valid value for OracleParameter.Value.
Please use OracleTimeStamp class for OracleParameter.OracleDbType == OracleDbType.TimeStamp
or OracleDate for OracleParameter.OracleDbType == OracleDbType.Date
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06


Return to dotConnect for Oracle