C#和Oracle Number数据类型 [英] C# and the Oracle Number Datatype
问题描述
我需要从Oracle数据库读取一个值,并且该字段已声明为Number(38).由于十进制类型不够大,我该如何在C#中做到这一点?
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?
推荐答案
您可以在数据读取器上调用GetString(ordinal)
,并将结果提供给System.Numerics.BigInteger.TryParse()
.
You could call GetString(ordinal)
on the data reader, and feed the result to System.Numerics.BigInteger.TryParse()
.
或者您可以将值保留在OracleDecimal
数据类型中,就像从ODP.NET接收到的那样. OracleDecimal
具有几乎所有功能,包括数学: Mulitply
,Round
,Exp
等.
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.
这篇关于C#和Oracle Number数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!