SqlDataAdapter.UpdateBatchSize SqlDataAdapter.UpdateBatchSize SqlDataAdapter.UpdateBatchSize SqlDataAdapter.UpdateBatchSize Property

定義

取得或設定每一次來回存取伺服器時所處理的資料列數目。Gets or sets the number of rows that are processed in each round-trip to the server.

public:
 virtual property int UpdateBatchSize { int get(); void set(int value); };
public override int UpdateBatchSize { get; set; }
member this.UpdateBatchSize : int with get, set
Public Overrides Property UpdateBatchSize As Integer

屬性值

每一批次要處理的資料列數目。The number of rows to process per-batch.

值為Value is 作用Effect
00 批次大小沒有任何限制。There is no limit on the batch size.
11 停用批次更新。Disables batch updating.
>1>1 使用 UpdateBatchSize 作業的批次一次傳送變更。Changes are sent using batches of UpdateBatchSize operations at a time.

將此設定為1以外的值時SqlDataAdapter , 所有與相關聯的命令都必須將其UpdatedRowSource屬性設定為None或。 OutputParametersWhen 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.

使用屬性, 即可利用來自的DataSet變更來更新資料來源。 UpdateBatchSizeUse 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.

如果值設定為小於零的數位,則會擲回。ArgumentOutOfRangeExceptionAn ArgumentOutOfRangeException is thrown if the value is set to a number less than zero.

適用於

另請參閱