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.156 -- Release Build+dcdaaebc8db0d076f561458ac184e317c7d68401
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

TaskDbDataReader
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