sql SqlBulkCopy
时间:2021-07-01 10:21:17
帮助过:4人阅读
void BuckCopy(DataTable dt,
string destinationTableName)
{
using (SqlConnection sqlConn = (SqlConnection)
this.CurrentDataBase.CreateConnection())
{
if (sqlConn.State !=
ConnectionState.Open)
sqlConn.Open();
using (SqlBulkCopy buckCopy =
new SqlBulkCopy(sqlConn))
{
buckCopy.DestinationTableName =
destinationTableName;
buckCopy.ColumnMappings.Add("ID",
"ID");
buckCopy.WriteToServer(dt);
}
}
}
sql SqlBulkCopy
标签:stat this column class tin des ble add style