asp.net.ph

OleDbParameterCollection.Add Method ( String, Object )

System.Data.OleDb Namespace   OleDbParameterCollection Class


Adds an OleDbParameter with the specified name and value to the parameters collection.

[ VB ]
Overloads Public Function Add ( _
   ByVal parameterName As String, _
   ByVal value As Object _
) As OleDbParameter

[ C# ]
public OleDbParameter Add (
   string parameterName,
   Object value
);

[ C++ ]
public: OleDbParameter* Add (
   String* parameterName,
   Object* value
);

[ JScript ]
public function Add (
   parameterName : String,
   value : Object
) : OleDbParameter;

Parameters

parameterName
The name of the parameter.
value
The parameter's value.

Return Value

The newly created OleDbParameter.

Remarks

When you specify an Object in the value parameter, the OleDbType is inferred from the .NET Framework type of the Object.

Example

The following example adds a new OleDbParameter using this constructor.

OleDbCommand cmd = new OleDbCommand ( null, conn );
cmd.CommandText = "Insert into Categories ( CategoryName ) values ( ? ) ";
cmd.Parameters.Add ( "@CategoryName", "Beverages" );
  C# VB

See Also

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