SqlHelper..::..FillDatasetAsync Method (String, CommandType, String, DataSet, array<String>[]()[][])

Execute a SqlCommand (that returns a resultset and takes no parameters) against the database specified in the connection string.

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

Syntax


public static Task FillDatasetAsync(
	string connectionString,
	CommandType commandType,
	string commandText,
	DataSet dataSet,
	string[] tableNames
)

Parameters

connectionString
Type: String
A valid connection string for a 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)

Return Value

Task.

Exceptions


ExceptionCondition
ArgumentNullException connectionString or dataSet

Remarks


e.g.: FillDatasetAsync(connString, CommandType.StoredProcedure, "GetOrders", ds, new string[] {"orders"});