Gemstone Data Library
Show/Hide TOC

# DataExtensionsExecuteReaderAsync(DbConnection, Int32, String, CancellationToken, Object) Method

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

## Definition

Namespace: Gemstone.Data.DataExtensions
Assembly: Gemstone.Data (in Gemstone.Data.dll) Version: 1.0.180 -- Release Build+0e3c143567ac1e22ccabc137e6e7d5395a9784d8
C#
View Source Request Example

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

VB
View Source Request Example

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

C++
View Source Request Example

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

JavaScript
View Source Request Example

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

#### Parameters

connection DbConnection
  The DbConnection to use for executing the SQL statement.
timeout Int32
  The time in seconds to wait for the SQL statement to execute.
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

ValueTuple Task DbDataReader, DbCommand
A DbDataReader object and its associated command.

#### Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DbConnection. 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