开发者

C# and the Oracle Number Datatype

开发者 https://www.devze.com 2023-01-09 18:32 出处:网络
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 th开发者_JAVA百科e Decimal type isn\'t big enough?You could call GetString(or

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 th开发者_JAVA百科e Decimal type isn't big enough?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号