dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleParameterCollection Class / Add Method / Add(String,OracleDbType,Object,ParameterDirection) Method
The name of the parameter.
One of the OracleDbType values.
The Devart.Common.DbParameterBase.Value of the OracleParameter to add to the collection.
Specifies whether the parameter is input, output, both, or it is the return value.
Example

In This Topic
    Add(String,OracleDbType,Object,ParameterDirection) Method
    In This Topic
    Adds a OracleParameter to the OracleParameterCollection given the parameter name, data type, value, and parameter direction.
    Syntax
    'Declaration
     
    Public Overloads Function Add( _
       ByVal parameterName As String, _
       ByVal dbType As OracleDbType, _
       ByVal value As Object, _
       ByVal direction As ParameterDirection _
    ) As OracleParameter

    Parameters

    parameterName
    The name of the parameter.
    dbType
    One of the OracleDbType values.
    value
    The Devart.Common.DbParameterBase.Value of the OracleParameter to add to the collection.
    direction
    Specifies whether the parameter is input, output, both, or it is the return value.

    Return Value

    The new OracleParameter object.
    Example
    The following example creates a OracleParameterCollection, adds instances of OracleParameter to the collection, and returns a reference to the new OracleParameter.
    public void CreateOracleParamColl(OracleConnection myConn) {
      OracleCommand myCommand = new OracleCommand("SELECT * FROM Test.Dept WHERE DeptNo = :DeptNo", myConn);
      OracleParameterCollection myParamCollection = myCommand.Parameters;
      OracleParameter myNewParameter = myParamCollection.Add("DeptNo", OracleDbType.Integer, 40, "DeptNo");
    }
    Public Sub CreateOracleParamColl(myConn As OracleConnection)
      Dim myCommand As OracleCommand = New OracleCommand("SELECT * FROM Test.Dept WHERE DeptNo = :DeptNo", myConn)
      Dim myParamCollection As OracleParameterCollection = myCommand.Parameters
      Dim myNewParameter As OracleParameter = myParamCollection.Add("DeptNo", OracleDbType.Integer, 40, "DeptNo")
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also