0
votes

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

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: String or binary data would be truncated.

I am getting this exception even after I did undo changes for the page, please someone help me to come out of this. *

2
The error says it all: if you would execute that SQL statement, data would be truncated. This means: you're trying to insert a string (or a binary data blob) that is too long for the column in the database that is supposed to hold it. If you try to insert 20 characters into a VARCHAR(10) column, this error happens.marc_s

2 Answers

0
votes

You are trying to insert a data (string or binary) longer than the maximum length possible for the target field.

0
votes

I agree with Morix Dev, your columndefintion is too small. The exception dosnt report which column is too small. But you could log out the data before insert, and check them against the definition.