SqlBulkCopy bulk insert data from a data source type String given value can not be converted to the target type column smalldatetime. error

Because of the heavy insert data, linq ef unable to meet the requirements of speed, so the model is converted to SQL, using SqlBulkCopy quickly insert. However, to prompt a given value of type String from the data source can not be converted to the target type column smalldatetime

Investigation for a long time only to find that the field order is inconsistent field order models and tables, leading to varchar type data corresponding to the data became smalldatetime is caused by the spill.

Guess you like

Origin www.cnblogs.com/billboy/p/11535643.html