System.Data.SqlClient Namespace SqlParameterCollection Class
Removes the specified SqlParameter from the collection.
[ VB ]
Public Sub Remove ( _
ByVal parameter As Object _
)
[ C# ]
void Remove (
object parameter
);
[ C++ ]
public: void Remove (
Object* parameter
);
[ JScript ]
public function Remove (
parameter : Object
);
- parameter
- The SqlParameter object to remove from the collection.
IList.Remove
The following example first uses the Contains property to find an SqlParameter with a given Value within the Parameters collection of a specifed SqlCommand object. If the parameter exists, the example removes it.
public void SearchSqlParams ( SqlCommand myCmd ) {
SqlParameterCollection myParams = myCmd.Parameters;
if ( myParams.Contains ( ( Object ) myParam ) )
myCmd.Parameters.Remove ( ( Object ) myParam );
}
Public Sub SearchSqlParams ( ByVal myCmd As SqlCommand )
Dim myParams As SqlParameterCollection = myCmd.Parameters
If myParams.Contains ( CType ( myParam, Object ) ) Then
myCmd.Parameters.Remove ( CType ( myParam, Object ) );
End If
End Sub |
|
C# |
VB |
SqlParameterCollection Members