SqlBulkCopy 的用法
string connectionstring="server=.;uid=sa;pwd=sa;database=test";
SqlBulkCopy sbc = new SqlBulkCopy(Guide.GetConnectionString(SPType.SP_R), SqlBulkCopyOptions.UseInternalTransaction);
sbc.BulkCopyTimeout = 5000;
sbc.NotifyAfter = dt.Rows.Count;
try
{
//tb_RealShippingFee 向那张表里面写数据
sbc.DestinationTableName = "tb_RealShippingFee";
//dt指 从那个数据源里往指定表写数据
sbc.WriteToServer(dt);
}
catch (Exception ex)
{
}