值必须小于无穷大 [英] value must be a number less than infinity
本文介绍了值必须小于无穷大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用中包含以下代码行:
I have the following line of code in my app:
packsize.CompanyPrice = (decimal)Reader["CompanyPrice"];
但它会引发错误从数字强制转换时,该值必须是小于无穷大的数字".
我已将数据库数据类型设置为double,但在我的应用程序中为十进制.会导致这个问题吗?
我在这里想念的是什么?
问候
SKPaul
but it raises an error "when casting from a number, the value must be a number less than infinity".
i have set database datatype as double, but in my app it is decimal. Does it cause this problem?
What i am missing here ??
Regards
SKPaul
推荐答案
看起来您的列的类型为float或real或其他较大的数字.大于十进制可以容纳.
我将尝试使用调试器查看您的数据库实际返回的内容.
请参阅有关如何调试的文章: Visual Studio中的高级调试 [ ^ ]
Looks like your column is of type float or real or some other large number. Larger than decimal can hold.
I would try the debugger to see what is actually returned by your database.
See this article on how to debug: Advanced Debugging in Visual Studio[^]
这篇关于值必须小于无穷大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文