Defines the number of rows to be processed before generating a notification event.
ArgumentOutOfRangeException
is thrown.The NotifyAfter
property is set so that the event handler is called after every 200 rows copied to the table.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connectionString))
{
// SET NotifyAfter value.
bulkCopy.NotifyAfter = 200;
bulkCopy.SqlRowsCopied += (sender, args) => { /* code */ };
bulkCopy.DestinationTableName = "TheDestinationTable";
bulkCopy.WriteToServer(reader);
}
NotifyAfter
property is designed for user interface components that illustrate the progress of a bulk copy operation.NotifyAfter
property can be set at any time, even while a bulk copy operation is underway.