Version

InitializeParameters Method

Initializes the IDataParameterCollection collection on the supplied database IDbCommand object based on the expected parameter schema.
Syntax
'Declaration
 
Public Function InitializeParameters( _
   ByVal currentCommand As IDbCommand, _
   ByVal factoryMethod As OperationContext.ParameterFactoryMethod, _
   ByVal commandSequenceNumber As Integer _
) As IDataParameterCollection

Parameters

currentCommand
The current IDbCommand object to have its parameters re-initialized.
factoryMethod
The factory method used to create new IDbDataParameter implementations. Frequently, this will be the CreateParameter method on the same IDbCommand-implementing type passed to currentCommand, but it may not necessarily be so when the developer has subclassed their WebScheduleDBProvider and overridden the CreateParameter method.
commandSequenceNumber
Since an operation can consist of a sequence of several steps (especially in dynamic SQL mode), this zero-based number indicates the step in processing of the operation. This affects which parameter schema is to be expected.

Return Value

An IDataParameterCollection initialized with the expected parameter schema for currentCommand at step commandSequenceNumber in the processing of the in-scope OperationContext. The caller must still populate argument values to complete the initialization of any input parameters.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionThrown when the currentCommand supplied is a null reference (Nothing in Visual Basic .NET). A non-null IDbCommand implementation is required to create a data parameters collection (of the appropriate implementation type) and attach it to the currentCommand.
Remarks

Calling this method will re-set the IDataParameterCollection on currentCommand to empty before adding the expected parameter set for this stage in processing.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also