字符串或二进制数据将被截断。该语句已终止。 System.Data.SqlClient.SqlException(0x80131904) [英] String or binary data would be truncated. The statement has been terminated. System.Data.SqlClient.SqlException (0x80131904)

查看:416
本文介绍了字符串或二进制数据将被截断。该语句已终止。 System.Data.SqlClient.SqlException(0x80131904)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


字符串或二进制数据将被截断。语句已终止。

String or binary data would be truncated. The statement has been terminated.

System.Data.SqlClient.SqlException(0x80131904):字符串或二进制数据将被截断

System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated


推荐答案

当C#(model)尝试保存其大小在SQL SERVER数据库表中定义得较小的列的数据记录(该值将值传递给此列字符串)时,抛出此异常

This exception throws when C#(model) try to save data record for column whose size defined less in SQL SERVER database table where value to pass to this column string length in greater.

要解决此错误,您只需使用SQL Server脚本更改SQL SERVER数据库中的表列。

To fix this error you only need to alter column of table in SQL SERVER database using SQL Server script.

仅增加表中列的大小。无需在PROD / TEST环境中重新部署应用程序。

Only increasing size of column in table works. No need to re deploy the application on PROD/TEST environment.

这篇关于字符串或二进制数据将被截断。该语句已终止。 System.Data.SqlClient.SqlException(0x80131904)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆