Page 1 of 1

The string was not recognized as a valid datetime

Posted: Wed 25 Oct 2006 01:35
by rmascaya
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?

Posted: Wed 25 Oct 2006 06:52
by Paul
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