I need to be able to create an untyped dataset from some sql using an
OracleDataAdapter. Unfortunately, I am getting problems where the result set
contains a large number of decimal places. I get the exception:
"An unhandled exception of type 'System.Data.OracleClient.OracleException'
occurred in system.data.dll
Additional information: OCI-22053: overflow error"
The problem seems to be that internally when calling Fill, the
OracleDataReader attempts to convert the number it gets into a System.Decimal
but it does not fit.
I do not know what the sql is going to be so I cannot modify it to limit the
values returned to a certain number of decimal places.
Does anyone have any ideas how I can get around this problem?
Thanks,
Jonathan
Code sample:
OracleConnection conn = new OracleConnection("MyDataSource");
OracleCommand cmd = new OracleCommand("select 1/3 from dual");
cmd.Connection = conn;
OracleDataAdapter adapter = new OracleDataAdapter();
adapter.FillError += new FillErrorEventHandler(FillError);
adapter.SelectCommand = cmd;
DataSet ds = new DataSet();
int rowsReturned = adapter.Fill(ds);
In .Net Framework V2.0, there is a new property on OracleDataAdapter called
ReturnProviderSpecificTypes in which the adapter will create the DataColumn
with OracleNumber instead of System.Decimal.
--
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Jonathan" <Jona...@discussions.microsoft.com> wrote in message
news:923E522B-9DD0-4B88...@microsoft.com...
Thanks for the information. It looks like I will have to write my own class
for creating a DataSet via a data reader. It seems somewhat rediculous that
you cannot do something so simple, I would be quite happy to lose the
precision.
Regards,
Jonathan
--
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Jonathan" <Jona...@discussions.microsoft.com> wrote in message
news:26CCC08F-76B7-4C5C...@microsoft.com...
Carlos Barini
SOLVE INFO
Brasil
--
cabarini
------------------------------------------------------------------------
cabarini's Profile: http://www.msusenet.com/member.php?userid=5002
View this thread: http://www.msusenet.com/t-1870982784