Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DbDataAdapter.UpdateBatchSize Property

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.

Namespace:  System.Data.Common
Assembly:  System.Data (in System.Data.dll)
public virtual int UpdateBatchSize { get; set; }

Property Value

Type: System.Int32
The number of rows to process per batch.

Value is

Effect

0

There is no limit on the batch size.

1

Disables batch updating.

> 1

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 DbDataAdapter must have their UpdatedRowSource property set to None or OutputParameters. An exception will be thrown otherwise.

Use the UpdateBatchSize property to update a data source with changes from a DataSet. If the data provider supports batch processing, this can increase application performance by reducing the number of round-trips to the server. In ADO.NET 2.0, this property is supported for the .NET data providers for SQL Server (SqlClient) and Oracle (OracleClient).

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

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

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft. All rights reserved.