Oracle integer is set to Decimal in the DataTable

  • Thread starter Thread starter John G
  • Start date Start date
J

John G

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
 
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

Did you read my last response before posting again? In summary of the
last post, you are most likely using OracleClient, which is not always
the best method of talking to Oracle due to the way it maps data types.
Anything you do prior to pulling data will always end up with decimal,
as that is how things are mapped. Choices (as mentioned in my last
post):

1. Switch provider (ODP.NET from Oracle is probably the best option)
2. Use a DataReader to fill the table and map to integer there

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top