System.Data.OleDb Namespace OleDbParameterCollection Class
Removes a parameter from the collection.
1. Removes the OleDbParameter at the specified index from the collection.
2. Removes the OleDbParameter with the given name from the collection.
The following example first uses the Contains property to find an OleDbParameter with a given ParameterName within the Parameters collection of a specifed OleDbCommand object. If the parameter exists, the example removes it.
NOTE: This example uses one of the overloaded versions of RemoveAt. For other examples that may be available, see the individual overload topics.
public void SearchOleDbParams ( OleDbCommand myCmd ) {
OleDbParameterCollection myParams = myCmd.Parameters;
if ( myParams.Contains ( "Description" ) )
myCmd.Parameters.RemoveAt ( "Description" );
}
Public Sub SearchOleDbParams ( ByVal myCmd As OleDbCommand )
Dim myParams As OleDbParameterCollection = myCmd.Parameters
If myParams.Contains ( "Description" ) Then
myCmd.Parameters.RemoveAt ( "Description" );
End If
End Sub |
|
C# |
VB |
OleDbParameterCollection Members