Jeff,
You most likely need to explictily add the REF CURSOR output parameter.
ADO, but not ADO.NET, allowed you to specify the "PLSQLRSet=1" connection
string option to have the Command object automatically do this for you when
populating an ADO Recordset.
This code should work, assuming you have an OUTPUT parameter named
p_ref_cursor that is your own package type that is a REF CURSOR.
using System.Data.OracleClient;
....
myOrclConnection = new System.Data.OracleClient.OracleConnection("Data
Source=;User ID=scott;Password=tiger;");
myOracleCommand = New OracleClient.OracleCommand();
myOracleCommand.CommandType = CommandType.StoredProcedure;
myOracleCommand.CommandText = "DRM.PKG.LIST";
myOracleCommand.Connection = myOrclConnection;
myOracleCommand.Parameters.Add("prm_1", OracleType.Int16);
myOracleCommand.Parameters("prm_1").Direction = ParameterDirection.Output;
myOracleCommand.Parameters.Add("p_ref_cursor", OracleType.Cursor);
myOracleCommand.Parameters("p_ref_cursor").Directi on =
ParameterDirection.Output;
OracleDataReader dr =
myOracleCommand.ExecuteReader(CommandBehavior.Clos eConnection);
DataGrid1.DataSource = dr;
DataGrid1.DataBind();
-Steve Jansen
"Jeff" <ja*******@hotmail.com> wrote in message
news:34****************************@phx.gbl...
Help!!
I'm trying to convert a visual basic stand alone program
into a Web Program using C#. There are a lot of Oracle
packages already written that I am trying to use
(unsuccessfully). Can someone point me in the right
direction on how to call an Oracle package into a
datagrid??
something like:
cnn.Open();
string sSelect = "{CALL DRM.PKG.LIST(?)}";
OracleCommand selectCommand = new OracleCommand(sSelect ,
cnn);
selectCommand.CommandType = CommandType.StoredProcedure;
OracleParameter prm1 = new OracleParameter();
prm1 = selectCommand.Parameters.Add("prm_1",
OracleType.Int16);
prm1.Direction = ParameterDirection.Output;
prm1.Value = 0;
OracleDataReader dr = selectCommand.ExecuteReader();
DataGrid1.DataSource = dr;
DataGrid1.DataBind();
Thanks Jeff.