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

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();
0
kiran_ch5
Asked:
kiran_ch5
1 Solution
 
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

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