|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem OLEDB Oracle with .Net 1.0 - Exeption when i have date fieHi,
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 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. -- Show quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA *************************** Think Outside the Box! *************************** "Luis Augusto M. Barbosa" wrote: > 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 |
|||||||||||||||||||||||