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

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

Parameters

parameterName
The name of the parameter.
dbType
One of the OracleDbType values.
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;
  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