Oracle integer is set to Decimal in the DataTable

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
 
G

Gregory A. Beamer

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

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