asp.net.ph

SqlParameterCollection.Clear Method

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 ( );

Remarks

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.

Example

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 ( );
}
  C# VB

See Also

SqlParameterCollection Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph