SqlBulkCopy invalid column length...but it's not
16:37 30 May 2018

My SqlBulkCopy command is throwing an exception saying

Received an invalid column length from the bcp client for colid 24.

If I look at the 24th (starting at 0) column as shown in Sql Server Mgmt Studio it's the SpaceID column. If I do it via the DataTable it's the Title column. Both are defined in the database as being a varchar(255). None of my columns for that are too big though. In the loop where I add the values to the DataTable I checked the length of each and reported on any larger than 254 characters and there are none.

What else could be causing this issue?

sql-server sqlbulkcopy