Export (0) Print
Expand All

OracleParameterCollection.Add Method (String, Object)

.NET Framework 1.1
Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Adds an OracleParameter to the OracleParameterCollection given the parameter name and value.

[Visual Basic]
Overloads Public Function Add( _
   ByVal parameterName As String, _
   ByVal value As Object _
) As OracleParameter
[C#]
public OracleParameter Add(
 string parameterName,
 object value
);
[C++]
public: OracleParameter* Add(
 String* parameterName,
 Object* value
);
[JScript]
public function Add(
   parameterName : String,
 value : Object
) : OracleParameter;

Parameters

parameterName
The name of the parameter.
value
The Value of the OracleParameter to add to the collection.

Return Value

The index of the new OracleParameter object.

Exceptions

Exception Type Condition
InvalidCastException The value parameter is not an OracleParameter.

Remarks

Use caution when using this overload of the Add method to specify integer parameter values. Because this overload takes a value of type Object, you must convert the integral value to an Object type when the value is zero, as the following C# example demonstrates.

parameters.Add("pname", Convert.ToInt32(0));

If you do not perform this conversion, the compiler will assume you are attempting to call the OracleParameterCollection.Add (string, OracleType) overload.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

OracleParameterCollection Class | OracleParameterCollection Members | System.Data.OracleClient Namespace | OracleParameterCollection.Add Overload List

Show:
© 2014 Microsoft