title: How do you use Oracle ODP.net ExecuteReader with SP that returns a cursor in C#?
body: <p>I have a procedure that returns a ref cursor. It takes 4 parameters and I am using C#. I have looked for examples all over the net but can't get any of them to work</p>
  
  <p>This is what I have</p>
  
  <pre><code>public static int test(int test_id, int progr, int setID, string BFilter)
  {
    object cur1 = System.DBNull.Value;
    string spname = "SP.GetValues";
  
    using (Oracle.DataAccess.Client.OracleCommand command = DB.GetStoredProcCommand(spname, test_id, progr, setID, BFilter, cur1))
    {
      using (OracleDataReader reader = command.ExecuteReader())
      {
        while (reader.Read())
        {
          //load array
        }
      }
    }
  
    int t = 1;
    return t;
  }
  </code></pre>
  
  <p>I was using a Dataset which worked fine except it was taking 20 secs everytime to get 500 rows and i have to do that 800 times.  I thought using a datareader, loading it into an array then looping over the array would be faster than reading into a dataset.  The SP itself takes 1 sec to return, it spends 19 secs in the fill line.</p>