SqlCeParameterCollection.RemoveAt Method (String)

Removes the SqlCeParameter with the specified name from the collection.

Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)

Syntax

'Declaration
Public Overrides Sub RemoveAt ( _
    parameterName As String _
)
'Usage
Dim instance As SqlCeParameterCollection
Dim parameterName As String

instance.RemoveAt(parameterName)
public override void RemoveAt (
    string parameterName
)
public:
virtual void RemoveAt (
    String^ parameterName
) override
public void RemoveAt (
    String parameterName
)
public override function RemoveAt (
    parameterName : String
)
Not applicable.

Parameters

  • parameterName
    The name of the parameter to remove.

Exceptions

Exception type Condition

ArgumentException

A parameter with the specified name does not exist in the collection.

Example

The following example searches for a SqlCeParameter with the specified ParameterName within a SqlCeParameterCollection collection. If the parameter exists, it is removed. This example assumes that a SqlCeCommand has already been created.

' ...
' create SqlCeCommand cmd
' ...
If cmd.Parameters.Contains("@Description") Then
    cmd.Parameters.RemoveAt("@Description")
End If
// ...
// create SqlCeCommand cmd
// ...
if (cmd.Parameters.Contains("@Description"))
    cmd.Parameters.RemoveAt("@Description");

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

.NET Compact Framework

Supported in: 2.0, 1.0

See Also

Reference

SqlCeParameterCollection Class
SqlCeParameterCollection Members
System.Data.SqlServerCe Namespace