Simplify the creation of an IDbCommand object by allowing a stored procedure and optional parameters to be provided

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

Syntax

C#
public virtual IDbCommand CreateCommand(
	string connectionString,
	string commandText,
	CommandType commandType,
	params IDataParameter[] commandParameters
)
Visual Basic
Public Overridable Function CreateCommand ( 
	connectionString As String,
	commandText As String,
	commandType As CommandType,
	ParamArray commandParameters As IDataParameter()
) As IDbCommand

Parameters

connectionString
Type: System..::..String
A valid connection string for an IDbConnection
commandText
Type: System..::..String
A valid SQL statement
commandType
Type: System.Data..::..CommandType
A System.Data.CommandType
commandParameters
Type: array<System.Data..::..IDataParameter>[]()[][]
The parameters for the SQL statement

Return Value

Type: IDbCommand
A valid IDbCommand object

See Also