Main Page | Report Page

 

  .NET DotNet Forum Index » ADO .NET Forum » Oracle integer is set to Decimal in the DataTable...

Author Message
John G...
Posted: Thu Dec 03, 2009 11:40 am
 
I have a query that returns a datatable in C# from Oracle. I have
done everything to make sure the queries column is a integer, but for
some reason in the datatable, it is listing it as a decimal.

I tried:
1) using cast in the oracle query
2) Create the column before filling the query to datatype Int32
 
Gregory A. Beamer...
Posted: Fri Dec 04, 2009 2:31 pm
 
John G <jwgiblin3 at (no spam) gmail.com> wrote in news:25434de7-5dd3-4dc4-830b-
00977d5a13cb at (no spam) e31g2000vbm.googlegroups.com:

Quote:
I have a query that returns a datatable in C# from Oracle. I have
done everything to make sure the queries column is a integer, but for
some reason in the datatable, it is listing it as a decimal.

I tried:
1) using cast in the oracle query
2) Create the column before filling the query to datatype Int32

What provider are you using for Oracle? OracleClient?

If so, I would suggest ODP.NET, which you can download from Oracle
TechNet. otn.oracle.com

It is much more well-tuned for the Oracle database than the Microsoft
created OracleClient.

If you MUST do this with OracleClient, consider using a DataReader and
filling the DataSet, with translation to Int32 as you fill the
DataTable. It should still be close to the same speed, as the DataReader
is used for the adapter's Fill() method, so you already have much of the
overhead when filling the DataTable.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: at (no spam) gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Fri Sep 30, 2016 8:38 am