当我通过浮点数选择时,我的 .net 数据表返回不正确的结果
我有一个数据表,其中一列是浮点数(system.single)。我试图选择该列(“半径”)小于或等于 2.5 的行,但得到的结果很愚蠢。 (我从 192 行中返回了 22 行,但所有这些行的 Radius 列都大于 2.5。我尝试了各种愚蠢的操作,例如将值放在单引号中,将列名称放在括号中,只是简单地小于...我有什么想法吗?
I have a datatable where one column is a float (a system.single). I'm trying to select the rows where that column ("Radius") is less than or equal to 2.5, but getting silly results. (I get 22 rows returned out of 192, but the Radius column of all those rows are greater than 2.5. I tried all kinds of silly things like putting the value in single quotes, putting the column name in brackets, doing just plain less than... I'm stumped. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的实际代码太大(而且有点复杂),无法发布在这里,但在尝试将其分解为可管理的内容的过程中,我发现了我的错误。我没有查看一个小的抽象层,假设数据行直接通过,但是(当然)这就是我的错误所在。我的调试不好...感谢您的帮助。
My actual code was too big (and a bit convoluted) to post here, but in the process of trying to factor it down to something manageable, I discovered my bug. I hadn't looked at a small abstraction layer, assuming the datarows were being passed straight through, but (of course) that's where my error was. Bad debugging on my part... thanks for your help.