Re: How to consume multiple result sets?

From: Pablo Castro [MS] (pablocas_at_online.microsoft.com)
Date: 03/24/05


Date: Thu, 24 Mar 2005 13:19:17 -0800

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

-- 
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Carl San" <Carl_San@hotmail.com> wrote in message 
news:eb8gnMKMFHA.1472@TK2MSFTNGP14.phx.gbl...
>I am using ADO.Net in VB.net application. .Net Framework 1.1.
>
>
>
> In a stored procedure I have multiple output parameters and multiple 
> result
> sets. How to code for this in ADO.Net?
>
> I have used MyCommandObject.ExecuteNonQuery() when there were only output
> parameters and no rows were returned from stored procedure.
>
>
>
> I have used
>
> Dim MyDataReader As SqlDataReader = MyCommandObject.ExecuteReader() when I
> wanted to read one set of result set returned by stored procedure.
>
>
>
> How to call a stored procedure when I have multiple output parameters and
> multiple results sets?
>
> Thanks,
>
> Carl
>
> 


Relevant Pages

  • Re: How to consume multiple result sets?
    ... Simply call NextResultin a loop until you go through all the ... >>> In a stored procedure I have multiple output parameters and multiple ... >>> How to call a stored procedure when I have multiple output parameters ... >>> Carl ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How to consume multiple result sets?
    ... Carl ... Simply call NextResultin a loop until you go through all the ... >> In a stored procedure I have multiple output parameters and multiple ... >> How to call a stored procedure when I have multiple output parameters ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Case statement issue
    ... except with a cursor other than the default ... > I have taken the sample of paging using a stored procedure from the ... > case statement, then the error message. ... > The for loop also seems to be a problem. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Case statement issue
    ... except with a cursor other than the default ... > I have taken the sample of paging using a stored procedure from the ... > case statement, then the error message. ... > The for loop also seems to be a problem. ...
    (microsoft.public.inetserver.asp.general)
  • Case statement issue
    ... Windows enterprise 2003 OS with IIS version 6 on the server. ... I have taken the sample of paging using a stored procedure from the website ... case statement, then the error message. ... The for loop also seems to be a problem. ...
    (microsoft.public.inetserver.asp.general)