如何使用NHibernate解决Sybase ODBC驱动程序中十进制值的问题?

如何使用NHibernate解决Sybase ODBC驱动程序中十进制值的问题?,nhibernate,fluent-nhibernate,odbc,sybase,decimal,Nhibernate,Fluent Nhibernate,Odbc,Sybase,Decimal,Sybase ODBC驱动程序存在十进制数据类型问题 例如,当应用程序试图在数据库中保存十进制值时,会出现以下错误: ERROR [22018] [DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Implicit conversion from datatype 'VARCHAR' to 'DECIMAL' is not allowed. Use the CONVERT function to run this query.

Sybase ODBC驱动程序存在十进制数据类型问题

例如,当应用程序试图在数据库中保存十进制值时,会出现以下错误:

ERROR [22018] [DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Implicit conversion from datatype 'VARCHAR' to 'DECIMAL' is not allowed.  Use the CONVERT function to run this query.
尝试将十进制参数传递给存储过程时也会发生相同的错误

我们如何使用NHibernate或Fluent NHibernate修复它


谢谢。

我还没有找到解决这个问题的简单方法。我在xml和POCO的系统中进行了更改。从十进制改为System.Double,它就可以工作了。我尝试使用CONVERT在xml文件中添加自己的sql insert和sql update,但效果不好(例如,值5.15更改为515)。

我还没有找到简单的解决方案。我在xml和POCO的系统中进行了更改。从十进制改为System.Double,它就可以工作了。我尝试使用CONVERT在xml文件中添加自己的sql insert和sql update,但效果不好(例如,将值5.15更改为515)。

数据库不支持将char、varchar隐式转换为十进制。这与JDBC的行为相同。请使用Convert函数并运行查询

数据库不支持将char、varchar隐式转换为decimal。这与JDBC的行为相同。请使用Convert函数并运行查询

为什么要使用ODBC?NHibernate支持Sybase客户端。此问题也会影响Sybase ASE的ADO.Net库。为什么要使用ODBC?NHibernate支持Sybase客户端。此问题也影响Sybase ASE的ADO.Net库。也切换到System.Double,它对我也适用(注意:使用Sybase ASE ADO.Net提供程序)。也切换到System.Double,它对我也适用(注意:使用Sybase ASE ADO.Net提供程序)。