将nvarchar值'1,500'转换为数据类型int时转换失败 [英] Conversion failed when converting the nvarchar value '1,500' to data type int
问题描述
异常
---------
将nvarchar值"1,500"转换为数据类型int时,转换失败.
说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息.
异常详细信息:System.Data.SqlClient.SqlException:将nvarchar值"1,500"转换为数据类型int时转换失败.
上述值1,500是应该有'',''我认为是这个'',''的值给了我我认为的错误.请为此提供解决方案"
Exception
---------
Conversion failed when converting the nvarchar value ''1,500'' to data type int.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Conversion failed when converting the nvarchar value ''1,500'' to data type int.
"the above value 1,500 is an amount which should have '','' i think this'','' is giving me the error i think.. please give me a solution for this"
推荐答案
解析它( http://msdn.microsoft.com/en-我们/library/t9ebt447.aspx [ ^ ]),然后再将其交给SQL客户端
语言环境将决定该值是1.5还是1500
Parse it (http://msdn.microsoft.com/en-us/library/t9ebt447.aspx[^]) before you hand it to the SQL client
Locale will dictate if that value is 1.5 or 1500
这篇关于将nvarchar值'1,500'转换为数据类型int时转换失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!