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