Click or drag to resize
AbstractDataConnectionExecuteReaderAsync Method

An asynchronous version of ExecuteReader(String, QueryDataParameters, QueryTypeEnum, CommandBehavior) which executes the query asynchronously and returns result as a DbDataReader.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

Namespace: CMS.DataEngine
Assembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 10.0.0
Syntax
C#
public virtual Task<DbDataReader> ExecuteReaderAsync(
	string queryText,
	QueryDataParameters queryParams,
	QueryTypeEnum queryType,
	CommandBehavior commandBehavior,
	CancellationToken cancellationToken
)

Parameters

queryText
Type: SystemString
Query or stored procedure to be run.
queryParams
Type: CMS.DataEngineQueryDataParameters
Query parameters.
queryType
Type: CMS.DataEngineQueryTypeEnum
Indicates if query is a SQL query or stored procedure.
commandBehavior
Type: System.DataCommandBehavior
Command behavior.
cancellationToken
Type: System.ThreadingCancellationToken
The cancellation instruction.

Return Value

Type: TaskDbDataReader
A task representing the asynchronous operation.

Implements

IDataConnectionExecuteReaderAsync(String, QueryDataParameters, QueryTypeEnum, CommandBehavior, CancellationToken)
Remarks
The method executes the query with command behavior CloseConnection if passed commandBehavior is set to Default and connection is not opened.
See Also