I have a stored procedure that runs 4 separate select statements. From there, in VB.NET, I use a datareader to get each of the 4 sets of records. With each set of records I populate an EXCEL file, one worksheet for each set of records

To get the first set of records from the stored procedure, I use
While datareader.Read
Get all of the data from first Select
End While

I then use
datareader.NextResult
While datareader.Read
Get all of the data from subsequent Selects
End While
to get the 2nd, 3rd, and 4th set of records.

My code will hang when, for example, the 3rd set of records has or returns no records. It takes the VB code a very long time to get past the empty 3rd record set, if at all, and never gets to the next and final 4th record set


Any suggestions on how I can get the code to move past any of these when one, or more of the Select statements return no records?

TIA
Bill