SqlBulkCopy.WriteToServer报错:“Unable to cast object of type 'System.Guid' to type 'System.String'.”
作者:C/S框架网|www.csframewo  发布日期:2023/03/22 14:27:36
  SqlBulkCopy.WriteToServer报错:“Unable to cast object of type 'System.Guid' to type 'System.String'.”

踩坑日记 - 使用 SqlBulkCopy 批量插入记录报错:
System.InvalidCastException:“Unable to cast object of type 'System.Guid' to type 'System.String'.”





正确的写法:


C# Code:

bulkCopy.WriteToServer(table, DataRowState.Added);

//来源:C/S框架网 | www.csframework.com | QQ:23404761






C/S框架网|原创精神.创造价值.打造精品


扫一扫加作者微信
C/S框架网作者微信 C/S框架网|原创作品.质量保障.竭诚为您服务
上一篇 下一篇