DB2ParameterCollection.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#] 以下示例在 DB2ParameterCollection 中的指定索引处搜索 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);
}