-1

I trying to write to a database, I have it connected, but I keep getting this

Error: SqlException: String or binary data would be truncated.

What is causing it and How do I fix it so I can write to the database?

Josh Adams
  • 17
  • 5
  • It means, your length of data or string larger than the length which has been defined in a table, inside the database. – Toan Vo Aug 23 '17 at 00:09

1 Answers1

1

It sounds like the data you are trying to commit to the database is larger than the allocated size for that field. As an example, you are trying to commit 50 characters to a field but the field is only allocated 10 characters. Check the data you are commiting and the size allocation of the field in the database.