asp.net.ph

OleDbParameterCollection.Add Method ( Object )

System.Data.OleDb Namespace   OleDbParameterCollection Class


Adds a new OleDbParameter object to the parameters collection.

[ VB ]
Overloads Public Sub Add ( _
   ByVal param As Object _
) As Integer

[ C# ]
public int object Add (
   Object param
);

[ C++ ]
public: int Add (
   Object* param
);

[ JScript ]
public function Add (
   param : Object
) : int ;

Parameters

param
The OleDbParameter to add.

Return Value

The index of the newly created OleDbParameter.

Implements

IList.Add

Exceptions


Exception Type Condition
ArgumentException The parameter passed is not an OleDbParameter.

Example

The following example adds a new OleDbParameter using this constructor.

public void CreateOleDbParamColl ( OleDbConnection myConn ) {
   OleDbCommand myCommand = new OleDbCommand (
      "SELECT * FROM Customers WHERE CustomerID = ?", myConn );
   OleDbParameterCollection myParams = myCommand.Parameters;
   object myParam = new OleDbParameter ( "CustomerID", OleDbType.VarChar ) );
   int pIndex = myParams.Add ( myParam );
}
  C# VB

See Also

OleDbParameterCollection Members   OleDbParameterCollection.Add 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