DB2 ParameterCollection.RemoveAt( Int32 ) 方法

从集合中移除指定索引处的 DB2Parameter 元素。

名称空间:
IBM.Data.DB2
组合件:
IBM.Data.DB2 (在 IBM.Data.DB2.dll)

语法


[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
);

参数

index
要除去的从零开始的参数下标。

异常

异常类型 条件
IndexOutOfRangeException 集合中不存在具有指定名称的参数。

示例

[Visual Basic, C#] 以下示例DB2 参数集合中按指定索引查找参数 DB2®。 如果该参数存在,那么将其除去。 此示例假设已 DB2ParameterCollection 创建一个。

[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);
 }