asp.net.ph

OleDbParameterCollection.Add Method ( String, OleDbType, Int32 )

System.Data.OleDb Namespace   OleDbParameterCollection Class


Adds an OleDbParameter with the specified name, data type, and column width to the parameters collection.

[ VB ]
Overloads Public Function Add ( _
   ByVal parameterName As String, _
   ByVal oleDbType As OleDbType, _
   ByVal size As Integer, _
) As OleDbParameter

[ C# ]
public OleDbParameter Add (
   string parameterName,
   OleDbType oleDbType,
   int size
);

[ C++ ]
public: OleDbParameter* Add (
   String* parameterName,
   OleDbType oleDbType,
   int size
);

[ JScript ]
public function Add (
   parameterName : String,
   oleDbType : OleDbType,
   size : int
) : OleDbParameter;

Parameters

parameterName
The name of the parameter.
oleDbType
One of the OleDbType values.
size
The width of the column.

Return Value

The newly created 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;
   OleDbParameter myParam = myParams.Add ( new OleDbParameter (
      "CustomerID", OleDbType.VarChar, 5 ) );
}
  C# VB

See Also

OleDbParameterCollection Members   OleDbParameterCollection.Add Overload List   OleDbType   ParameterName   Size 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