我正在使用 SqlBulkCopy。所以我制作了一个数据表并指定了它的列,然后将行添加到数据表中,然后尝试插入它。
System.InvalidOperationException is unhandled by user code Message=The given value of type String from the data source cannot be convert to type int of the specified target
我一直收到这个错误。问题是我有 3 个 int 列,但我不知道它是哪一个。
我什至在每个 int 列上加上了它的类型。
datatable.Columns.Add("Id", typeof(int));
好像还是有问题。那么在堆栈跟踪或 int 异常中的哪个位置会说它死亡的实际列?