Name of the destination table on the server.
using (var sqlBulk = new SqlBulkCopy(connection))
{
// SET DestinationTableName value.
sqlBulk.DestinationTableName = "Customers";
// ...ColumnMappings & Options...
sqlBulk.WriteToServer(dt);
}
DestinationTableName
has not been set when WriteToServer is called, an ArgumentNullException
is thrown.DestinationTableName
is modified while a WriteToServer operation is running, the change does not affect the current operation.DestinationTableName
value is used the next time a WriteToServer method is called.