SqlParameterCollection.Remove Method (SqlParameter)
Removes the specified SqlParameter from the collection.
Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Parameters
- value
- Type: System.Data.SqlClient.SqlParameter
A SqlParameter object to remove from the collection.
| Exception | Condition |
|---|---|
| InvalidCastException | The parameter is not a SqlParameter. |
| SystemException | The parameter does not exist in the collection. |
The following example searches for a SqlParameter object in a SqlParameterCollection collection. If the parameter exists, the example removes it. This example assumes that a SqlParameterCollection collection has already been created by a SqlCommand.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.