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 ;
- param
- The OleDbParameter to add.
The index of the newly created OleDbParameter.
IList.Add
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 );
}
Public Sub CreateOleDbParamColl ( myConn As OleDbConnection )
Dim myCommand As New OleDbCommand ( _
"SELECT * FROM Customers WHERE CustomerID = ?", myConn )
Dim myParams As OleDbParameterCollection = myCommand.Parameters
Dim myParam As Object = New OleDbParameter ( "CustomerID", OleDbType.VarChar ) )
Sim pIndex As Integer = myParams.Add ( myParam )
End Sub |
|
C# |
VB |
OleDbParameterCollection Members OleDbParameterCollection.Add Overload List