Solved

Loading multiple tables using stored procedure

Posted on 2004-03-30
3
461 Views
Last Modified: 2012-06-21
is it possible to write a stored procedure that when run in vb.net that it would fill multiple tables in the dataset?
maybe something like
select one table
.
.
.
go

select another table
.
.
.
go
0
Comment
Question by:BangorCC
3 Comments
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 50 total points
ID: 10714576
yes.  For instance, if you use a DataReader, you can then issue a NextResult method, to move to the second set of records.

AW
0
 
LVL 12

Accepted Solution

by:
dfiala13 earned 100 total points
ID: 10714597
Yes.

If you use a DataAdapter's Fill method

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclassfilltopic.asp

It will automatically populate the dataset with all the returned tables defined by the multiple select statements.
0
 
LVL 7

Assisted Solution

by:dante469
dante469 earned 100 total points
ID: 10716733
Depending on the version of SQL you may not be able to put GO in your stored proc....  You do not need GO between each select :)...

The following stored proc will return multiple tables that are easily accessible from the DataAdapters.fill method...

CREATE PROCEDURE DBO.sp_EmployeeDump  AS

select * from Employee
select * from EmployeeDetail

GO
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bound data table problem 2 40
abstract class C# 1 36
Convert Silverlight ERP To Angularjs,HTML5 3 56
Consume a webservice via VB in Visual Studio 2015 3 15
Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question