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



While inserting data into database if you get the following error " System.Data.SqlClient.SqlException: String or binary data would be truncated.
The statement has been terminated." as shown in the image below

Then the fix for this issue was, you have to check the field lengths for all the columns in the table you are trying to insert the values.

surely one of the field length is less than the data you are trying to insert into the table. Now read the error message once again. It will be very clear.

Comments