Get an IDbCommand for using in loading / querying.

Namespace:  NHibernate.Engine
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
Function PrepareQueryCommand ( _
	commandType As CommandType, _
	sql As SqlString, _
	parameterTypes As SqlType() _
) As IDbCommand
C#
IDbCommand PrepareQueryCommand(
	CommandType commandType,
	SqlString sql,
	SqlType[] parameterTypes
)
Visual C++
IDbCommand^ PrepareQueryCommand(
	CommandType commandType, 
	SqlString^ sql, 
	array<SqlType^>^ parameterTypes
)
JavaScript
function prepareQueryCommand(commandType, sql, parameterTypes);

Parameters

commandType
Type: System.Data..::.CommandType
The CommandType of the command.
sql
Type: NHibernate.SqlCommand..::.SqlString
The SqlString to convert to an IDbCommand.
parameterTypes
Type: array< NHibernate.SqlTypes..::.SqlType >[]()[]
The SqlTypes of parameters in sql.

Return Value

An IDbCommand that is ready to be executed.

Remarks

If not explicitly released by CloseCommand(IDbCommand, IDataReader), it will be released when the session is closed or disconnected.

This does NOT add anything to the batch - it only creates the IDbCommand and does NOT cause the batch to execute...

See Also