How do you use in C# an Oracle ODP.net ExecuteReader with SP that return
I have a procedure that returns a ref cursor. It takes 4 parameters am using C#. I have looked for examples all over the net but can't get any of them to work. Using 10gr2 on unix with C# 4.0
this is what i have
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
}
}
}
}
error i get when it runs is : Operation is not valid due to the current state of the object.
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 though using a datareader, loading the data it returns 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.