Enables/disables a SqlBulkCopy
object to stream data from an IDataReader
object
If a SqlBulkCopy object can stream data from an IDataReader object, the value is true
; otherwise, false
.
using (var sqlBulk = new SqlBulkCopy(connection))
{
// SET EnableStreaming value.
sqlBulk.EnableStreaming = true;
sqlBulk.DestinationTableName = "Customers";
sqlBulk.WriteToServer(dt);
}
EnableStreaming
is true
, SqlBulkCopy reads from an IDataReader object using SequentialAccess, optimizing memory usage by using the IDataReader streaming capabilities.false
, the SqlBulkCopy class loads all the data returned by the IDataReader object into memory before sending it to SQL Server or SQL Azure.