SqlHelper..::..ExecuteDataset Method (SqlTransaction, String, array<Object>[]()[][])

Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlTransaction using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order.

Namespace:  Core
Assembly:  Core (in Core.dll)

Syntax


public static DataSet ExecuteDataset(
	SqlTransaction transaction,
	string spName,
	params Object[] parameterValues
)

Parameters

transaction
Type: SqlTransaction
A valid SqlTransaction
spName
Type: String
The name of the stored procedure
parameterValues
Type: array<Object>[]()[][]
An array of objects to be assigned as the input values of the stored procedure

Return Value

A dataset containing the resultset generated by the command

Exceptions


ExceptionCondition
ArgumentNullException transaction or spName
ArgumentExceptionThe transaction was rollbacked or commited, please provide an open transaction. - transaction

Remarks


This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: DataSet ds = ExecuteDataset(trans, "GetOrders", 24, 36);