DB2ParameterCollection.RemoveAt (String) Method

Removes the DB2Parameter with the specified name 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 parameterName As String _
)
[C#]
public void RemoveAt(
   string parameterName
);
[C++]
public: __sealed void RemoveAt(
   String* parameterName
);
[JScript]
public function RemoveAt(
   parameterName : String
);

Parameters

parameterName
The name 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 DB2®Parameter with the specified DB2Parameter.Name 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
    ' ...
    If myParameters.Contains("Description") Then
        myParameters.RemoveAt("Description")
    End If
End Sub 'SearchDB2Params

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