Uredi

Deli z drugimi prek


DbDataSource.CreateBatch Method

Definition

Returns a DbBatch that's ready for execution against the DbDataSource.

public:
 System::Data::Common::DbBatch ^ CreateBatch();
public System.Data.Common.DbBatch CreateBatch ();
member this.CreateBatch : unit -> System.Data.Common.DbBatch
Public Function CreateBatch () As DbBatch

Returns

A DbBatch that's ready for execution against the DbDataSource.

Remarks

Batches returned from this method are already configured to execute against their originating DbDataSource; their Connection does not need to be set, and doing so will throw an exception.

Since these batches have no explicitly-managed connection, it is not possible to use them with transactions, and trying to set Transaction will throw an exception. To use a transaction, get a connection from OpenConnection and create a command against it.

Applies to