• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 733
  • Last Modified:

Oracle REFCURSOR and DataGrid


I have Oracle Stored Procedure That Returns 5 Output Parameters and  one refcursor and Takes 2 Input Parameters.
When I executed this Procedures I am getting individual parameter Values but not the Refcursor Values.

I am tring to bind the REFCURSOR values to a MyDataGrid and dispaly that Datagrid in my .aspx page.

It is just showing the fieldNames but not the Values of fields... Can you please help me why it is doing that.... Following is my Code


oCmd.Parameters.Add("p_funnel_id", OracleType.Number, 100).Value = 12;
                        oCmd.Parameters.Add("p_date", OracleType.DateTime, 500).Value = "28-MAR-2005";

                        OracleParameter oParam1  = new OracleParameter("p_name", OracleType.VarChar,500);
                        oParam1.Direction = ParameterDirection.Output;

                        OracleParameter oParam2  = new OracleParameter("p_desc", OracleType.VarChar,500);
                        oParam2.Direction = ParameterDirection.Output;

                        OracleParameter oParam3  = new OracleParameter("p_creator", OracleType.VarChar,500);
                        oParam3.Direction = ParameterDirection.Output;

                        OracleParameter oParam4  = new OracleParameter("p_editors", OracleType.VarChar,500);
                        oParam4.Direction = ParameterDirection.Output;

                        OracleParameter oParam5  = new OracleParameter("p_funnel_report", OracleType.Cursor,500);
                        oParam5.Direction = ParameterDirection.Output;

                        OracleParameter oParam6  = new OracleParameter("p_error", OracleType.VarChar,500);
                        oParam6.Direction = ParameterDirection.Output;
                        //get the data
                        ds = new DataSet();
                        OracleDataAdapter adapter = new OracleDataAdapter(oCmd);
                        MyDataGrid.DataSource = ds;

                        f_name_ro.Text= oParam1.Value.ToString();
                        f_desc_ro.Text = oParam2.Value.ToString();
                        f_creator_ro.Text = oParam3.Value.ToString();
                        f_editors_ro.Text = oParam4.Value.ToString();
1 Solution
MyDataGrid.DataSource = ds.Tables["Reports"];
instead of
MyDataGrid.DataSource = ds;

kiran_ch5Author Commented:
I don't think that is the Problem... Any how I tried but it did not work.....

Now My code is like this... still not working

//get the data
ds = new DataSet();
OracleDataAdapter adapter = new OracleDataAdapter(oCmd);
MyDataGrid.DataSource = ds.Tables["Reports"];

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now