System.InvalidCastException: The data value could not be converted for reasons other than sign mismatch or data overflow.

gucs 2004-01-15 10:50:58
错误信息
System.InvalidCastException: The data value could not be converted for reasons other than sign mismatch or data overflow. For example, the data was corrupted in the data store but the row was still retrievable.

我使用的数据库是access,其中一个字段是“双精度”型,使用GetFloat、GetDouble、GetDecimal都不能正确读取。不知道是为什么。

各位是否遇到过类似问题,请告知,谢谢!
...全文
215 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
gucs 2004-01-15
  • 打赏
  • 举报
回复
类似的情况出现了几次,关闭vs.net后,再重新打开,或者重启后,程序就可以正常使用了。代码并没有修改。我想,是否因为调试器有些数据库驻留内存造成的。

哪位有类似的经历,谈谈想法。
dfg35_-433 2004-01-15
  • 打赏
  • 举报
回复
同意!
polarlm 2004-01-15
  • 打赏
  • 举报
回复
程序可能还是有些小bug
还要多看看
gucs 2004-01-15
  • 打赏
  • 举报
回复
莫明其妙的好用了,我什么都没有改。

只是将vs.net关闭后,重新打开,重新编译一下而已。

不知道为什么。

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧