DbBatch.ExecuteDbDataReader(CommandBehavior) Method

Definition

When overridden in a derived class, executes the batch against its connection, returning a DbDataReader which can be used to access the results.

protected abstract System.Data.Common.DbDataReader ExecuteDbDataReader (System.Data.CommandBehavior behavior);

Parameters

behavior
CommandBehavior

An instance of CommandBehavior, specifying options for batch execution and data retrieval.

Returns

A DbDataReader object.

Exceptions

An error occurred while executing the batch.

The CommandBehavior value is invalid.

Remarks

When the batch returns multiple result sets from different commands, NextResult() can be used to advance the reader to the next result set.

Applies to

Product Versions
.NET 6, 7, 8, 9