0

I'm having SAP HANA studio & developing an addon using C# in SAP B1. I want to know how to read multiple results from stored procedure? I used recordset

string Query = @"call ""P_TESTGMRMPLAN"" ('"+PlanId+"')"; 
oRset.DoQuery(Query);

Is it possible using recordset? How? If no, then any alternate way for this or could you please give me sample example?

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
neha
  • 23
  • 3
  • Not sure how SAP works, but Dapper supports multiple return record sets (https://stackoverflow.com/questions/6317937/dapper-net-and-stored-proc-with-multiple-result-sets). So does straight up ADO.NET with datareaders and `.NextResult` https://stackoverflow.com/questions/3840484/how-to-handle-multiple-resultsets-each-with-multiple-rows-idatareader-nextresu – Flydog57 May 19 '23 at 12:43

1 Answers1

0

you can use EoF & MoveNext to navigate through the results of the query and use either column name or index to retrieve your values.

while (oRset.EoF == False) 
{
  MessageBox.Show(oRset.Fields.Item(1).Value);
  MessageBox.Show(oRset.Fields.Item("myColumnName").Value);
  oRset.MoveNext();
}
Praxiom
  • 578
  • 1
  • 8
  • 21