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.150 -- Release Build+539c8e20daab1f37d91aaa1ede2f080b59c0c784
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