SqlHelper..::..FillDataset Method (SqlConnection, String, DataSet, array<String>[]()[][], array<Object>[]()[][])

Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlConnection 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 void FillDataset(
	SqlConnection connection,
	string spName,
	DataSet dataSet,
	string[] tableNames,
	params Object[] parameterValues
)

Parameters

connection
Type: SqlConnection
A valid SqlConnection
spName
Type: String
The name of the stored procedure
dataSet
Type: DataSet
A dataset wich will contain the resultset generated by the command
tableNames
Type: array<String>[]()[][]
This array will be used to create table mappings allowing the DataTables to be referenced by a user defined name (probably the actual table name)
parameterValues
Type: array<Object>[]()[][]
An array of objects to be assigned as the input values of the stored procedure

Exceptions


ExceptionCondition
ArgumentNullException connection or dataSet or spName

Remarks


This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: FillDataset(conn, "GetOrders", ds, new string[] {"orders"}, 24, 36);