Once you use MyCommandObject.ExecuteNonQuery() to execute your SP The datareader object returned by ExecuteReader() has a "NextResult()" method. Simply call NextResult() in a loop until you go through all the results. In sort-of-VB:
reader = command.ExecuteReader() do do while reader.Read() ' process the row loop loop while reader.NextResult() ' this moves to the next result-set
Returning multiple result sets You can have multiple queries inside a single sproc, as shown in the following sproc code: ALTER PROCEDURE MultipleResultSets AS Select * from Products; Select * from Customers;
Once you use MyCommandObject.ExecuteNonQuery() to execute your SP The datareader object returned by ExecuteReader() has a "NextResult()" method. Simply call NextResult() in a loop until you go through all the results. In sort-of-VB:
reader = command.ExecuteReader() do do while reader.Read() ' process the row loop loop while reader.NextResult() ' this moves to the next result-set