SqlCeParameterCollection.RemoveAt Method (Int32)

Removes the SqlCeParameter at the specified index from the collection.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

public override void RemoveAt(
	int index
)

Parameters

index
Type: System.Int32
The zero-based index of the parameter to remove.

Implements

IList.RemoveAt(Int32)

ExceptionCondition
IndexOutOfRangeException

The specified index does not exist.

The following example removes the first SqlCeParameter within a SqlCeParameterCollection. If the parameter exists, it is removed. This example assumes that a SqlCeCommand has already been created.

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


Show: