SqlCeParameterCollection.RemoveAt 方法 (Int32)

从集合中移除指定索引位置的 SqlCeParameter

命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 system.data.sqlserverce.dll 中)

语法

声明
Public Overrides Sub RemoveAt ( _
    index As Integer _
)
用法
Dim instance As SqlCeParameterCollection
Dim index As Integer

instance.RemoveAt(index)
public override void RemoveAt (
    int index
)
public:
virtual void RemoveAt (
    int index
) override
public void RemoveAt (
    int index
)
public override function RemoveAt (
    index : int
)
不适用。

参数

  • index
    要移除的参数的从零开始的索引。

异常

异常类型 条件

IndexOutOfRangeException

指定的索引不存在。

示例

下面的示例移除 SqlCeParameterCollection 中的第一个 SqlCeParameter。如果该参数存在,则将其移除。此示例假定已经创建了 SqlCeCommand

' ...
' create SqlCeCommand cmd
' ...
If cmd.Parameters.Count > 0 Then
    cmd.Parameters.RemoveAt(0)
End If
// ...
// create SqlCeCommand cmd
// ...
if (cmd.Parameters.Count > 0)
{
    cmd.Parameters.RemoveAt(0);
}

平台

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

Windows Vista、Microsoft Windows XP SP2 和 Windows Server 2003 SP1 支持 Microsoft .NET Framework 3.0。

版本信息

.NET Framework

受以下版本支持:3.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

SqlCeParameterCollection 类
SqlCeParameterCollection 成员
System.Data.SqlServerCe 命名空间