Oracle REFCURSOR and DataGrid

HI,


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;
                        oCmd.Parameters.Add(oParam1);

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

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

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


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

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

                        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();
kiran_ch5Asked:
Who is Participating?
 
rajaloysiousCommented:
Try
MyDataGrid.DataSource = ds.Tables["Reports"];
instead of
MyDataGrid.DataSource = ds;

cheers
0
 
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);
adapter.Fill(ds,"Reports");                         
                        
MyDataGrid.DataSource = ds.Tables["Reports"];
MyDataGrid.DataBind();
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.