Execute an IDbCommand (that returns a resultset) against the database specified in the connection string using the provided parameters.

Namespace: CodeSmith.Engine
Assembly: CodeSmith.Engine (in CodeSmith.Engine.dll) Version: 6.0.0.0 (7.0.0.15127)

Syntax

C#
public virtual void FillDataset(
	string connectionString,
	CommandType commandType,
	string commandText,
	DataSet dataSet,
	string[] tableNames,
	params IDataParameter[] commandParameters
)
Visual Basic
Public Overridable Sub FillDataset ( 
	connectionString As String,
	commandType As CommandType,
	commandText As String,
	dataSet As DataSet,
	tableNames As String(),
	ParamArray commandParameters As IDataParameter()
)

Parameters

connectionString
Type: System..::..String
A valid connection string for an IDbConnection
commandType
Type: System.Data..::..CommandType
The CommandType (stored procedure, text, etc.)
commandText
Type: System..::..String
The stored procedure name or SQL command
dataSet
Type: System.Data..::..DataSet
A DataSet wich will contain the resultset generated by the command
tableNames
Type: array<System..::..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<System.Data..::..IDataParameter>[]()[][]
An array of IDataParameters used to execute the command

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionThrown if connectionString is null
System..::..InvalidOperationExceptionThrown if any of the IDataParameters.ParameterNames are null, or if the parameter count does not match the number of values supplied
System..::..ArgumentNullExceptionThrown if commandText is null
System..::..ArgumentExceptionThrown if the parameter count does not match the number of values supplied

See Also