简体   繁体   English

C#和Oracle Number数据类型

[英]C# and the Oracle Number Datatype

I need to read a value from an Oracle database and the field has been declared as Number(38). 我需要从Oracle数据库中读取一个值,并且该字段已声明为Number(38)。 How can I do this in C# since the Decimal type isn't big enough? 我怎么能用C#做这个,因为Decimal类型不够大?

You could call GetString(ordinal) on the data reader, and feed the result to System.Numerics.BigInteger.TryParse() . 您可以在数据读取器上调用GetString(ordinal) ,并将结果提供给System.Numerics.BigInteger.TryParse()

Or perhaps you could leave the value in the OracleDecimal datatype, like you received it from ODP.NET. 或者也许您可以将值保留在OracleDecimal数据类型中,就像从ODP.NET接收它一样。 OracleDecimal has functions for almost everything, including math : Mulitply , Round , Exp , and so on. OracleDecimal几乎包含所有功能, 包括数学MulitplyRoundExp等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM