asp.net.ph

OleDbParameterCollection.Remove Method

System.Data.OleDb Namespace   OleDbParameterCollection Class


Removes the specified OleDbParameter 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
);

Parameters

parameter
The OleDbParameter object to remove from the collection.

Implements

IList.Remove

Exceptions


Exception Type Condition
InvalidCastException The parameter is not an OleDbParameter.
SystemException The parameter does not exist in the collection.

Example

The following example first uses the Contains property to find an OleDbParameter with a given Value within the Parameters collection of a specifed OleDbCommand object. If the parameter exists, the example removes it.

public void SearchOleDbParams ( OleDbCommand myCmd ) {
   OleDbParameterCollection myParams = myCmd.Parameters;
   if ( myParams.Contains ( ( Object ) myParam ) )
      myCmd.Parameters.Remove ( ( Object ) myParam );

}
  C# VB

See Also

OleDbParameterCollection 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