Gemstone Data Library
Show/Hide TOC

# DataExtensionsExecuteReaderAsync(DbCommand, String, CancellationToken, Object) Method

Executes the SQL statement using DbCommand, and builds a DbDataReader.

## Definition

Namespace: Gemstone.Data.DataExtensions
Assembly: Gemstone.Data (in Gemstone.Data.dll) Version: 1.0.181 -- Release Build+8ede4e2e3eaa7e2f6590bec626fa21d2a2e0b470
C#
View Source Request Example

    public static Task<DbDataReader> ExecuteReaderAsync(
    	this DbCommand command,
    	string sql,
    	CancellationToken cancellationToken,
    	params Object?[] parameters
    )

VB
View Source Request Example

    <ExtensionAttribute>
    Public Shared Function ExecuteReaderAsync (
    	command As DbCommand,
    	sql As String,
    	cancellationToken As CancellationToken,
    	ParamArray parameters As Object()
    ) As Task(Of DbDataReader)

C++
View Source Request Example

    public:
    [ExtensionAttribute]
    static Task<DbDataReader^>^ ExecuteReaderAsync(
    	DbCommand^ command,
    	String^ sql,
    	CancellationToken cancellationToken,
    	... array<Object^>^ parameters
    )

JavaScript
View Source Request Example

    Gemstone.Data.DataExtensions.DataExtensions.ExecuteReaderAsync = function(command, sql, cancellationToken, ... parameters);

#### Parameters

command DbCommand
  The DbCommand to use for executing the SQL statement.
sql String
  The SQL statement to be executed.
cancellationToken CancellationToken
  Propagates notification that operations should be canceled.
parameters Object
  The parameter values to be used to fill in DbParameter parameters identified by '@' prefix in sql expression.

#### Return Value

Task DbDataReader
A DbDataReader object.

#### Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DbCommand. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

## See Also

#### Reference

DataExtensions Class
ExecuteReaderAsync Overload
Gemstone.Data.DataExtensions Namespace