dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleParameterCollection Class / Add Method / Add(String,OracleDbType) Method
The name of the parameter.
One of the OracleDbType values.
Example

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

    Parameters

    parameterName
    The name of the parameter.
    type
    One of the OracleDbType values.

    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;
      object myParm = new OracleParameter("DeptNo", OracleDbType.Integer);
      int pIndex = myParamCollection.Add(myParm);
    }
    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 myParm As Object = New OracleParameter("DeptNo", OracleDbType.Integer)
      Dim pIndex As Integer = myParamCollection.Add(myParm)
    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