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.153 -- Release Build+42f3d0bf0373d5bc86f6d691e637d32f2b3150d2
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