0

I use VB.NET Studio Express 2012 to read a filestream into SQL Server Express. The database and table are created fine, most records load without error using .ExecuteNonQuery INSERT INTO, but some records I get the error:

String or binary data would be truncated.

Originally this was correct, because the column was only 20 characters and the data was between 22-25 on the failing records. I have changed the table so the column now is 30 char, but the error is still the same. I dropped the database and recreated it, but still the same problem.

Does VB keep info on field length somewhere?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user2488689
  • 61
  • 1
  • 2

1 Answers1

0

May be some spaces are present before or after your string,you can use Trim() function and then try to insert.Trim function will remove extra spaces placed before and after you string.