Problem OLEDB Oracle with .Net 1.0 - Exeption when i have date fie

G

Guest

Hi,

We have one application that return the exception below, when retrieve any
date fields:

"Specified argument was out of the range of valid values.
Parameter name: Hour, Minute, and Second parameters describe an
unrepresentable DateTime."

If change from OLEDB to Oracle Provider the exception disappear, however we
can´t change this application in this time.

This application use .NET 1.0, Oracle 9.2.0.7.0 and OLEDB Provider.

Could anyone help us show any solution or article for this problem?
(Therefore i need show in my job)

Thanks
 
G

Guest

What generally happens is this. A system is set up with a default of min
date. As Oracle uses a date that is wider than OLEDB, it causes an exception
when cast to the OLEDB type. If this is true, it means you have someone that
nulls dates by setting to min value, which for Oracle is outside of the range
acceptable by the OLEDB provider. I know of no way to get around this other
than fixing the database to allow a true null (as it is unlikely (not
impossible, but unlikely) that the dates blowing this sky high are valid for
the app).

You are too far down the stack to cast to another type and kludging up your
stored procedures (you are using sprocs, right?) is not the wisest option,
although you could cast the dates as strings there.

I would venture that the change to the OracleClient (or Oracle's ODP.NET) is
the best option. With a replace in files, you can switch this over relatively
easy if you are using normal design patterns.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top