简体   繁体   English

具有IDataRecord的OverFlowException

[英]OverFlowException with IDataRecord

I had a x64 WinForms program working fine with MySQL and ODBC connector. 我有一个x64 WinForms程序,可以在MySQL和ODBC连接器上正常工作。 Until one machine made me change to x86 and now I have this line of code: 直到有一台机器使我更改为x86,现在我有了以下代码行:

var someValue = data.GetString(3);

and throws me a OverFlowException. 并抛出了一个OverFlowException。 I tryed to change to: 我尝试更改为:

var someValue = (string)data[3];

but is the same throuble. 但是同样的麻烦。 I have more problems when it comes to get numbers. 获取数字时,我还有更多问题。

I switch my plataform to "Any CPU" but nothing changes. 我将平台切换为“任何CPU”,但没有任何变化。

Exception: 例外:

System.OverflowException: Arithmetic operation resulted in an overflow. at System.Data.Odbc.OdbcDataReader.GetSqlType(Int32 i) at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i) at System.Data.Odbc.DbCache.AccessIndex(Int32 i) at System.Data.Odbc.OdbcDataReader.internalGetString(Int32 i) at System.Data.Odbc.OdbcDataReader.GetString(Int32 i) at MyProject.Clases.Catalogos.Cartt..ctor(IDataRecord data) at c:\\Users\\Develop\\Documents\\Visual Studio 2013\\Projects\\MyProject\\Clases\\Catalog\\Cartt.cs:línea 113

any suggestions? 有什么建议么?

好的,我通过在项目属性中将平台首选项设置为x86来解决此问题。

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

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