Export (0) Print
Expand All

OracleParameterCollection.Add Method

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

Adds the specified OracleParameter to the OracleParameterCollection.

Overload List

Adds the specified OracleParameter to the OracleParameterCollection.

[Visual Basic] Overloads Public Overridable Function Add(Object) As Integer Implements IList.Add
[C#] public virtual int Add(object);
[C++] public: virtual int Add(Object*);
[JScript] public function Add(Object) : int;

Adds the specified OracleParameter to the OracleParameterCollection.

[Visual Basic] Overloads Public Function Add(OracleParameter) As OracleParameter
[C#] public OracleParameter Add(OracleParameter);
[C++] public: OracleParameter* Add(OracleParameter*);
[JScript] public function Add(OracleParameter) : OracleParameter;

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

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

Adds an OracleParameter to the OracleParameterCollection given the parameter name and data type.

[Visual Basic] Overloads Public Function Add(String, OracleType) As OracleParameter
[C#] public OracleParameter Add(string, OracleType);
[C++] public: OracleParameter* Add(String*, OracleType);
[JScript] public function Add(String, OracleType) : OracleParameter;

Adds an OracleParameter to the OracleParameterCollection given the parameter name, data type, and column length.

[Visual Basic] Overloads Public Function Add(String, OracleType, Integer) As OracleParameter
[C#] public OracleParameter Add(string, OracleType, int);
[C++] public: OracleParameter* Add(String*, OracleType, int);
[JScript] public function Add(String, OracleType, int) : OracleParameter;

Adds an OracleParameter to the OracleParameterCollection given the parameter name, data type, column length, and source column name.

[Visual Basic] Overloads Public Function Add(String, OracleType, Integer, String) As OracleParameter
[C#] public OracleParameter Add(string, OracleType, int, string);
[C++] public: OracleParameter* Add(String*, OracleType, int, String*);
[JScript] public function Add(String, OracleType, int, String) : OracleParameter;

Example

[Visual Basic, C#, C++] The following example creates an OracleParameterCollection, adds an instance of OracleParameter to the collection, and returns a reference to the new OracleParameter.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of Add. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub CreateOracleParamColl(myConn As OracleConnection)
  Dim myCommand As OracleCommand = New OracleCommand("SELECT Ename, DeptNo FROM Emp WHERE EmpNo = :pEmpNo", myConn)
  Dim myParamCollection As OracleParameterCollection = myCommand.Parameters
  Dim myNewParameter As OracleParameter = myParamCollection.Add("pEmpNo", OracleType.Number, 5, "EmpNo")
End Sub 'CreateOracleParamColl

[C#] 
public void CreateOracleParamColl(OracleConnection myConn) {
    OracleCommand myCommand = new OracleCommand("SELECT Ename, DeptNo FROM Emp WHERE EmpNo = :pEmpNo", myConn);
    OracleParameterCollection myParamCollection = myCommand.Parameters;
    OracleParameter myNewParameter = myParamCollection.Add("pEmpNo", OracleType.Number, 5, "EmpNo");
 }

[C++] 
public:
void CreateOracleParamColl(OracleConnection* myConn) {
    OracleCommand* myCommand = new OracleCommand(S"SELECT Ename, DeptNo FROM Emp WHERE EmpNo = :pEmpNo", myConn);
    OracleParameterCollection* myParamCollection = myCommand->Parameters;
    OracleParameter* myNewParameter = myParamCollection->Add(S"pEmpNo", OracleType::Number, 5, S"EmpNo");
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

OracleParameterCollection Class | OracleParameterCollection Members | System.Data.OracleClient Namespace

Show:
© 2014 Microsoft