asp.net.ph

OleDbParameterCollection.Contains Method ( Object )

System.Data.OleDb Namespace   OleDbParameterCollection Class


Checks whether a given OleDbParameter object is in the collection.

[ VB ]
Overloads Public Function Contains ( _
   ByVal value As Object _
) As Boolean

[ C# ]
public bool Contains (
   object value
);

[ C++ ]
public: bool Contains (
   Object* value
);

[ JScript ]
public function Contains (
   value : Object
) : Boolean

Parameters

value
The Value of the OleDbParameter object to find.

Return Value

true if the collection contains the parameter; otherwise, false.

Example

The following example shows use of 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 displays the index of the parameter; otherwise, the example displays an error.

public void SearchOleDbParams ( OleDbCommand myCmd ) {
   OleDbParameterCollection myParams = myCmd.Parameters;
   if ( myParams.Contains ( ( Object ) myParam ) )
      MessageBox.Show ( "Match found on parameter " + 
         myParams.IndexOf ( ( Object ) myParam ).ToString ( ) );
   else
      MessageBox.Show ( "Sorry, no such parameter found in the collection" );

}
  C# VB

See Also

OleDbParameterCollection Members   OleDbParameterCollection.Contains Overload List 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