Dotnet-Project Framework documentation.

GenericDataHelper.ExecuteReaderTransactional Method (IDbTransaction, String, IDataParameter[])

Execute a Command (that returns a resultset) against the specified Transaction using the provided parameters.

public static IDataReader ExecuteReaderTransactional(
   out IDbTransaction aTransaction,
   string spName,
   params IDataParameter[] commandParameters
);

Parameters

aTransaction
The transaction used and that you must close.
spName
The stored procedure name or T-SQL command
commandParameters
An array of Paramters used to execute the command

Return Value

A DataReader containing the resultset generated by the command

Remarks

This method does not close the transaction created. You must close the transaction when you have finished to work with the reader.

Example

IDbTransaction transaction = null;
SqlDataReader dr = (SqlDataReader)ExecuteReader(out transaction, "GetOrders", new SqlParameter("@prodid", 24));
/* Do work */
dr.Close();
dr.Dispose();
transaction.Close();
 

See Also

GenericDataHelper Class | DotnetProject.Data Namespace | GenericDataHelper.ExecuteReaderTransactional Overload List