I am using SqlBulkCopy. So I made the data and pointed the columns, then added the rows to the datatable, and then try to insert it.
Exception System.InvalidOperationException unhandled by user code Message = specified value of type String from data source cannot be converted to int type of specified target
I still get this error. The thing is, I have 3 int columns, and I don't know what it is.
I even put its type in each int column.
datatable.Columns.Add("Id", typeof(int));
Apparently a problem. So where in the stack trace or int will the exception indicate the actual column on which it is dying?
source
share