SqlBulkCopy
Lets you efficiently bulk load a SQL Server table with data from another source.
Number of rows in each batch. At the end of each batch, the rows in the batch are sent to the server.
Number of seconds for the operation to complete before it times out.
Returns a collection of SqlBulkCopyColumnMapping items. Column mappings define the relationships between columns in the data source and columns in the destination.
Name of the destination table on the server.
Enables or disables a SqlBulkCopy object to stream data from an IDataReader object
Defines the number of rows to be processed before generating a notification event.
Occurs every time that the number of rows specified by the NotifyAfter property have been processed.
Initializes a new instance of the SqlBulkCopy class using the specified open instance of SqlConnection.
public SqlBulkCopy(SqlConnection connection, SqlBulkCopyOptions copyOptions, SqlTransaction externalTransaction)
Initializes a new instance of the SqlBulkCopy class using the supplied existing open instance of SqlConnection. The SqlBulkCopy instance behaves according to options supplied in the copyOptionscopyOptions parameter. If a non-null SqlTransaction is supplied, the copy operations will be performed within that transaction.
Initializes and opens a new instance of SqlConnection based on the supplied connectionStringconnectionString. The constructor uses the SqlConnection to initialize a new instance of the SqlBulkCopy class.
Initializes and opens a new instance of SqlConnection based on the supplied connectionStringconnectionString. The constructor uses that SqlConnection to initialize a new instance of the SqlBulkCopy class. The SqlConnection instance behaves according to options supplied in the copyOptionscopyOptions parameter.
Closes the SqlBulkCopy instance.
Copies all rows from the supplied DbDataReader array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
Copies all rows from the supplied DataRow array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
Copies all rows in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
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.
Copies all rows in the supplied IDataReader to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The asynchronous version of WriteToServer, which copies all rows from the supplied DbDataReader array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The asynchronous version of WriteToServer, which copies all rows from the supplied DbDataReader array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The asynchronous version of WriteToServer, which copies all rows from the supplied DataRow array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The asynchronous version of WriteToServer, which copies all rows from the supplied DataRow array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
The asynchronous version of WriteToServer, which copies all rows in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The asynchronous version of WriteToServer, which 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.
public Task WriteToServerAsync(DataTable table, DataRowState rowState, CancellationToken cancellationToken)
The asynchronous version of WriteToServer, which 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.
The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
The asynchronous version of WriteToServer, which copies all rows in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
The asynchronous version of WriteToServer, which copies all rows in the supplied IDataReader to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The asynchronous version of WriteToServer, which copies all rows in the supplied IDataReader to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.