SqlHelper..::..ExecuteXmlReaderAsync Method (SqlTransaction, CommandType, String, array<SqlParameter>[]()[][])
Execute a SqlCommand (that returns a resultset) against the specified SqlTransaction
using the provided parameters.
Namespace:
CoreAssembly: Core (in Core.dll)
Syntax
public static Task<XmlReader> ExecuteXmlReaderAsync( SqlTransaction transaction, CommandType commandType, string commandText, params SqlParameter[] commandParameters )
Parameters
- transaction
- Type: SqlTransaction
A valid SqlTransaction
- commandType
- Type: CommandType
The CommandType (stored procedure, text, etc.)
- commandText
- Type: String
The stored procedure name or T-SQL command using "FOR XML AUTO"
- commandParameters
- Type: array<SqlParameter>[]()[][]
An array of SqlParamters used to execute the command
Return Value
An XmlReader containing the resultset generated by the commandExceptions
Exception | Condition |
---|---|
ArgumentNullException | transaction |
ArgumentException | The transaction was rollbacked or commited, please provide an open transaction. - transaction |