473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to read multiple resultsets into a set of data readers?

I have a stored proc that returns 5 resultsets. How can I read each
resultset into a separate data reader?

Thanks
Nov 17 '05 #1
1 2591
Bot quite sure what you are asking. However, if you make 1 proc call that
returns 5 result sets, you need to call NextResult() on your DataReader to
advance to the next result set. Pseudo code below:

//initialise connection and command
DataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
//now in 1st result set
//process 1st
if (reader.NextResult())
{
//2nd
}

//etc.
}

If you want 5 separate data readers, call the process separately.

HTH
Dan
"Frank Rizzo" wrote:
I have a stored proc that returns 5 resultsets. How can I read each
resultset into a separate data reader?

Thanks

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Top Gun | last post by:
In order to avoid multiple trips to the database, I would like to fill several tables in a DataSet with a single call to a stored procedure that will return resultsets for the appropriate tables. ...
0
by: Crazy Cat | last post by:
Hi, Using Visual Basic 2005 -- I have a stored procedure that returns multiple resultsets. I fill a datareader (SQLDataReader to be exact) with the results from a command object's ExecuteReader...
2
by: Lair | last post by:
I am creating a page that has three to four databound dropdown lists. Each one is has different data sometimes from the same table but with a different where clause. What is the best way to...
8
by: dosworldguy | last post by:
I have been having a very peculiar issue from a long time. I have an application where multiple clients read from a shared set of files. When a record is changed, sometimes the win9x clients...
1
by: Robson Siqueira | last post by:
Folks, For designing WinApps, I do prefer to have the controls dragged and dropped into the screen, mainly for datagridview controls. For that end, I normally use the DataSet designer but...
5
by: troy | last post by:
Could someone please point me in the right direction on how to read in a large query with .net. I am trying to emulate a legacy database system so I don't know the upper bounds of the sql query....
4
by: Chris | last post by:
This might be a stupid question.... I have a stored procedures, which uses two selects. When I run the SP I get two resultsets, one very big and the other much smaller, which is the one I want in...
10
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I'm using this coding to get 2 resultsets thru datareader and then load them into 2 datatables and bind the datatables to datagridviews. But sdrGrid.NextResult() is returning false for some...
0
by: Camfa | last post by:
Hi all, I’ve been messing around with the following question for 2 days now, and i still haven’t find a fix. So i hope you can help me. I’ll quickly show you guys the situation: There are 2...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.