Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# and the Oracle Number Datatype

Tags:

c#

types

oracle

I need to read a value from an Oracle database and the field has been declared as Number(38). How can I do this in C# since the Decimal type isn't big enough?

like image 643
kirk.burleson Avatar asked Nov 05 '22 10:11

kirk.burleson


1 Answers

You could call GetString(ordinal) on the data reader, and feed the result to System.Numerics.BigInteger.TryParse().

Or perhaps you could leave the value in the OracleDecimal datatype, like you received it from ODP.NET. OracleDecimal has functions for almost everything, including math: Mulitply, Round, Exp, and so on.

like image 104
Andomar Avatar answered Nov 12 '22 19:11

Andomar