Oracle REFCURSOR and DataGrid

Posted on 2005-04-05
Last Modified: 2008-02-01

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();
Question by:kiran_ch5
    LVL 8

    Accepted Solution

    MyDataGrid.DataSource = ds.Tables["Reports"];
    instead of
    MyDataGrid.DataSource = ds;


    Author Comment

    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"];

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now