System.Data.SqlClient Namespace SqlParameterCollection Class
Clears the collection of any parameters.
[ VB ]
Public Sub Clear ( )
[ C# ]
public void Clear ( );
[ C++ ]
public: void Clear ( );
[ JScript ]
public function Clear ( );
Use this method to remove all SqlParameter objects from the Parameters collection of a specified command. To remove a particular SqlParameter from the collection, use either the Remove or RemoveAt method.
This method resets the Parameters.Count property to 0.
The following example gets the SqlParameterCollection of a given SqlCommand, then clears the collection.
private void ClearParams ( SqlCommand cmd ) {
SqlParameterCollection myParams = cmd.Parameters;
myParams.Clear ( );
}
Private Sub ClearParams ( ByVal cmd As SqlCommand )
Dim myParams As SqlParameterCollection = cmd.Parameters
myParams.Clear ( )
End Sub |
|
C# |
VB |
SqlParameterCollection Members