DB2 Version 9.7 for Linux, UNIX, and Windows

DB2ParameterCollection.RemoveAt (Int32) Method

Removes the DB2Parameter at the specified index from the collection.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax

[Visual Basic]
NotOverridable Overloads Public Sub RemoveAt( _
   ByVal index As Integer _
)
[C#]
public void RemoveAt(
   int index
);
[C++]
public: __sealed void RemoveAt(
   int index
);
[JScript]
public function RemoveAt(
   index : int
);

Parameters

index
The zero-based index of the parameter to remove.

Exceptions

Exception type Condition
IndexOutOfRangeException A parameter with the specified name does not exist in the collection.

Example

[Visual Basic, C#] The following example searches for a DB2Parameter at the specified index within a DB2ParameterCollection . If the parameter exists, it is removed. This example assumes that a DB2ParameterCollection has already been created.

[Visual Basic]
Public 
Sub SearchDB2Params() '
    ... '
    create DB2ParameterCollection myParameters and DB2Parameter myNewParam "Param7"
    ' ...
    If myParameters.Contains(Param7) Then
        myParameters.RemoveAt(7)
    End If
End Sub 'SearchDB2Params

[C#]
public 
void SearchDB2Params() { //
    ... //
    create DB2ParameterCollection myParameters and DB2Parameter myNewParam "Param7"
    // ...
    if (myParameters.Contains(Param7))
       myParameters.RemoveAt(7);
 }