The string was not recognized as a valid datetime

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
rmascaya
Posts: 4
Joined: Sat 12 Aug 2006 06:16

The string was not recognized as a valid datetime

Post by 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?

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by 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

Post Reply