Click or drag to resize
IDataConnectionExecuteScalarAsync Method

An asynchronous version of ExecuteScalar(String, QueryDataParameters, QueryTypeEnum, Boolean), which executes the query asynchronously and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

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: 11.0.0
Syntax
C#
Task<Object> ExecuteScalarAsync(
	string queryText,
	QueryDataParameters queryParams,
	QueryTypeEnum queryType,
	bool requiresTransaction,
	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
requiresTransaction
Type: SystemBoolean
If true, the query should run within transaction.
cancellationToken
Type: System.ThreadingCancellationToken
The cancellation instruction.

Return Value

Type: TaskObject
A task representing the asynchronous operation.
See Also