Export (0) Print
Expand All

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 */
public int get_UpdateBatchSize ()

/** @property */
public void set_UpdateBatchSize (int value)

public function get UpdateBatchSize () : int

public function set UpdateBatchSize (value : int)

Not applicable.

Property Value

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). See Performing Batch Updates with a DataAdapter for more information.

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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2014 Microsoft