DbCommand.ExecuteReaderAsync DbCommand.ExecuteReaderAsync DbCommand.ExecuteReaderAsync DbCommand.ExecuteReaderAsync Method

定义

ExecuteReader 的异步版本,针对 CommandTextConnection 执行 DbDataReaderAn asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

重载

ExecuteReaderAsync() ExecuteReaderAsync() ExecuteReaderAsync() ExecuteReaderAsync()

ExecuteReader 的异步版本,针对 CommandTextConnection 执行 DbDataReaderAn asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

通过 CancellationToken.None 调用 ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken)Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken) with CancellationToken.None.

ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior)

ExecuteReader 的异步版本,针对 CommandTextConnection 执行 DbDataReaderAn asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

调用 ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

ExecuteReaderAsync(CancellationToken) ExecuteReaderAsync(CancellationToken) ExecuteReaderAsync(CancellationToken)

ExecuteReader 的异步版本,针对 CommandTextConnection 执行 DbDataReaderAn asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader. 此方法传播有关应取消操作的通知。This method propagates a notification that operations should be canceled.

调用 ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

ExecuteReaderAsync(CommandBehavior, CancellationToken) ExecuteReaderAsync(CommandBehavior, CancellationToken) ExecuteReaderAsync(CommandBehavior, CancellationToken)

调用 ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

注解

托管提供程序实施者必须调用ExecuteDbDataReaderAsyncExecuteReaderAsyncManaged provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. 有关异步编程的详细信息,请参阅异步编程For more information about asynchronous programming, see Asynchronous Programming.

ExecuteReaderAsync() ExecuteReaderAsync() ExecuteReaderAsync() ExecuteReaderAsync()

ExecuteReader 的异步版本,针对 CommandTextConnection 执行 DbDataReaderAn asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

通过 CancellationToken.None 调用 ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken)Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken) with CancellationToken.None.

public:
 System::Threading::Tasks::Task<System::Data::Common::DbDataReader ^> ^ ExecuteReaderAsync();
public System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteReaderAsync ();
member this.ExecuteReaderAsync : unit -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
Public Function ExecuteReaderAsync () As Task(Of DbDataReader)

返回

表示异步操作的任务。A task representing the asynchronous operation.

异常

执行命令文本时出现的一个错误。An error occurred while executing the command text.

注解

托管提供程序实施者必须调用ExecuteDbDataReaderAsyncExecuteReaderAsyncManaged provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. 有关异步编程的详细信息,请参阅异步编程For more information about asynchronous programming, see Asynchronous Programming.

另请参阅

ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior)

ExecuteReader 的异步版本,针对 CommandTextConnection 执行 DbDataReaderAn asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

调用 ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

public:
 System::Threading::Tasks::Task<System::Data::Common::DbDataReader ^> ^ ExecuteReaderAsync(System::Data::CommandBehavior behavior);
public System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteReaderAsync (System.Data.CommandBehavior behavior);
member this.ExecuteReaderAsync : System.Data.CommandBehavior -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
Public Function ExecuteReaderAsync (behavior As CommandBehavior) As Task(Of DbDataReader)

参数

返回

表示异步操作的任务。A task representing the asynchronous operation.

异常

执行命令文本时出现的一个错误。An error occurred while executing the command text.

注解

托管提供程序实施者必须调用ExecuteDbDataReaderAsyncExecuteReaderAsyncManaged provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. 有关异步编程的详细信息,请参阅异步编程For more information about asynchronous programming, see Asynchronous Programming.

另请参阅

ExecuteReaderAsync(CancellationToken) ExecuteReaderAsync(CancellationToken) ExecuteReaderAsync(CancellationToken)

ExecuteReader 的异步版本,针对 CommandTextConnection 执行 DbDataReaderAn asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader. 此方法传播有关应取消操作的通知。This method propagates a notification that operations should be canceled.

调用 ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

public:
 System::Threading::Tasks::Task<System::Data::Common::DbDataReader ^> ^ ExecuteReaderAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteReaderAsync (System.Threading.CancellationToken cancellationToken);
member this.ExecuteReaderAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>

参数

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

要监视取消请求的标记。The token to monitor for cancellation requests.

返回

表示异步操作的任务。A task representing the asynchronous operation.

异常

执行命令文本时出现的一个错误。An error occurred while executing the command text.

注解

托管提供程序实施者必须调用ExecuteDbDataReaderAsyncExecuteReaderAsyncManaged provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. 有关异步编程的详细信息,请参阅异步编程For more information about asynchronous programming, see Asynchronous Programming.

另请参阅

ExecuteReaderAsync(CommandBehavior, CancellationToken) ExecuteReaderAsync(CommandBehavior, CancellationToken) ExecuteReaderAsync(CommandBehavior, CancellationToken)

调用 ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

public:
 System::Threading::Tasks::Task<System::Data::Common::DbDataReader ^> ^ ExecuteReaderAsync(System::Data::CommandBehavior behavior, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteReaderAsync (System.Data.CommandBehavior behavior, System.Threading.CancellationToken cancellationToken);
member this.ExecuteReaderAsync : System.Data.CommandBehavior * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>

参数

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

要监视取消请求的标记。The token to monitor for cancellation requests.

返回

表示异步操作的任务。A task representing the asynchronous operation.

异常

执行命令文本时出现的一个错误。An error occurred while executing the command text.

注解

托管提供程序实施者必须调用ExecuteDbDataReaderAsyncExecuteReaderAsyncManaged provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. 有关异步编程的详细信息,请参阅异步编程For more information about asynchronous programming, see Asynchronous Programming.

另请参阅

适用于