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

Execute a SqlCommand (that returns a resultset) against the specified SqlConnection using the provided parameters.

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

Syntax


public static void FillDataset(
	SqlConnection connection,
	CommandType commandType,
	string commandText,
	DataSet dataSet,
	string[] tableNames,
	params SqlParameter[] commandParameters
)

Parameters

connection
Type: SqlConnection
A valid SqlConnection
commandType
Type: CommandType
The CommandType (stored procedure, text, etc.)
commandText
Type: String
The stored procedure name or T-SQL command
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)
commandParameters
Type: array<SqlParameter>[]()[][]
An array of SqlParamters used to execute the command

Remarks


e.g.: FillDataset(conn, CommandType.StoredProcedure, "GetOrders", ds, new string[] {"orders"}, new SqlParameter("@prodid", 24));