UpdateBatchSize Property

SqlDataAdapter.UpdateBatchSize Property


Gets or sets the number of rows that are processed in each round-trip to the server.

Namespace:   System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)

override UpdateBatchSize : int with get, set

Property Value

Type: System.Int32

The number of rows to process per-batch.

Value is



There is no limit on the batch size..


Disables batch updating.


Changes are sent using batches of UpdateBatchSize operations at a time.

When setting this to a value other than 1, all the commands associated with the SqlDataAdapter have to have their UpdatedRowSource property set to None or OutputParameters. An exception is thrown otherwise.

Gets or sets a value that enables or disables batch processing support, and specifies the number of commands that can be executed in a batch.

Use the UpdateBatchSize property to update a data source with changes from a DataSet. This can increase application performance by reducing the number of round-trips to the server.

Executing an extremely large batch could decrease performance. Therefore, you should test for the optimum batch size setting before implementing your application.

An ArgumentOutOfRangeException is thrown if the value is set to a number less than zero.

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft