asp.net.ph

OleDbParameterCollection.Add Method ( String, OleDbType, Int32, String )

System.Data.OleDb Namespace   OleDbParameterCollection Class


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

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

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

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

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

Parameters

parameterName
The name of the parameter.
oleDbType
One of the OleDbType values.
size
The width of the column.
srcColumn
The name of the source 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, "CustomerID" ) );
}
  C# VB

See Also

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