This method opens (if necessary) and assigns a connection, transaction, command type and parameters to the provided command

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

Syntax

C#
protected virtual void PrepareCommand(
	IDbCommand command,
	IDbConnection connection,
	IDbTransaction transaction,
	CommandType commandType,
	string commandText,
	IDataParameter[] commandParameters,
	out bool mustCloseConnection
)
Visual Basic
Protected Overridable Sub PrepareCommand ( 
	command As IDbCommand,
	connection As IDbConnection,
	transaction As IDbTransaction,
	commandType As CommandType,
	commandText As String,
	commandParameters As IDataParameter(),
	<OutAttribute> ByRef mustCloseConnection As Boolean
)

Parameters

command
Type: System.Data..::..IDbCommand
The IDbCommand to be prepared
connection
Type: System.Data..::..IDbConnection
A valid IDbConnection, on which to execute this command
transaction
Type: System.Data..::..IDbTransaction
A valid IDbTransaction, or 'null'
commandType
Type: System.Data..::..CommandType
The CommandType (stored procedure, text, etc.)
commandText
Type: System..::..String
The stored procedure name or SQL command
commandParameters
Type: array<System.Data..::..IDataParameter>[]()[][]
An array of IDataParameters to be associated with the command or 'null' if no parameters are required
mustCloseConnection
Type: System..::..Boolean%
true if the connection was opened by the method, otherwose is false.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionThrown if command is null.
System..::..ArgumentNullExceptionThrown if commandText is null.

See Also