Re: How to consume multiple result sets?
From: Pablo Castro [MS] (pablocas_at_online.microsoft.com)
Date: 03/24/05
- Next message: juliensellgren_at_hotmail.com: "Appending to an indexed DataTable - performance degrades"
- Previous message: Pablo Castro [MS]: "Re: Use of dbnull.value causes datatype declaration to be nvarchar(4000)"
- In reply to: Carl San: "How to consume multiple result sets?"
- Messages sorted by: [ date ] [ thread ]
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 > >
- Next message: juliensellgren_at_hotmail.com: "Appending to an indexed DataTable - performance degrades"
- Previous message: Pablo Castro [MS]: "Re: Use of dbnull.value causes datatype declaration to be nvarchar(4000)"
- In reply to: Carl San: "How to consume multiple result sets?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|