Add(String,OracleDbType,ParameterDirection) Method
Adds a
OracleParameter to the
OracleParameterCollection given the parameter name, data type, and direction.
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
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