Execute an IDbCommand (that returns a resultset) against the specified IDbTransaction
using the provided parameters.
Namespace: CodeSmith.EngineAssembly: CodeSmith.Engine (in CodeSmith.Engine.dll) Version: 6.0.0.0 (7.0.0.15127)
Syntax
C# |
---|
public virtual IDataReader ExecuteReader( IDbTransaction transaction, CommandType commandType, string commandText, params IDataParameter[] commandParameters ) |
Visual Basic |
---|
Public Overridable Function ExecuteReader ( transaction As IDbTransaction, commandType As CommandType, commandText As String, ParamArray commandParameters As IDataParameter() ) As IDataReader |
Parameters
- transaction
- Type: System.Data..::..IDbTransaction
A valid IDbTransaction
- commandType
- Type: System.Data..::..CommandType
The CommandType (stored procedure, text, etc.)
- commandText
- Type: System..::..String
The stored procedure name or SQL command
- commandParameters
- Type: array<System.Data..::..IDataParameter>[]()[][]
An array of IDataParameters used to execute the command
Return Value
Type: IDataReaderA IDataReader containing the resultset generated by the command
Examples
Copy | |
---|---|
IDataReader dr = helper.ExecuteReader(trans, CommandType.StoredProcedure, "GetOrders", new IDataParameter("@prodid", 24)); |