ExecuteQueryAsync Method
ExecuteQueryAsync(string, object[], SqlStatementOptions, CancellationToken)
Executes a SQL query.
Declaration
Task<ISqlQueryResult> ExecuteQueryAsync(string sql, object[] parameters = null, SqlStatementOptions options = null, CancellationToken cancellationToken = default)
Parameters
string | sql | The SQL query text to execute. |
object[] | parameters | Parameters for the SQL query. |
SqlStatementOptions | options | Options for the SQL query (defaults to Default). |
CancellationToken | cancellationToken | A cancellation token. |
Returns
Task<ISqlQueryResult> | An ISqlQueryResult instance that represents the result of the query. |
Remarks
The sql
query text can contain parameter placeholders, specified via a '?' character. Each
occurrence of the '?' character is replaced by the next parameter from the parameters
ordered list.
ExecuteQueryAsync(string, SqlStatementOptions, CancellationToken, params object[])
Executes a SQL query.
Declaration
Task<ISqlQueryResult> ExecuteQueryAsync(string sql, SqlStatementOptions options = null, CancellationToken cancellationToken = default, params object[] parameters)
Parameters
string | sql | The SQL query text to execute. |
SqlStatementOptions | options | Options for the SQL query (defaults to Default). |
CancellationToken | cancellationToken | A cancellation token. |
object[] | parameters | Parameters for the SQL query. |
Returns
Task<ISqlQueryResult> | An ISqlQueryResult instance that represents the result of the query. |
Remarks
The sql
query text can contain parameter placeholders, specified via a '?' character. Each
occurrence of the '?' character is replaced by the next parameter from the parameters
ordered list.