Export (0) Print
Expand All

SqlBulkCopy.WriteToServer Method

Copies all rows from a data source to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method WriteToServer(DataRow[]) Copies all rows from the supplied DataRow array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
Public method WriteToServer(DataTable) Copies all rows in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
Public method WriteToServer(IDataReader) Copies all rows in the supplied IDataReader to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
Public method WriteToServer(DataTable, DataRowState) Copies only rows that match the supplied row state in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
Top

If multiple active result sets (MARS) is disabled, WriteToServer makes the connection busy. If MARS is enabled, you can interleave calls to WriteToServer with other commands in the same connection.

Show:
© 2014 Microsoft