Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Loading multiple tables using stored procedure

Posted on 2004-03-30
3
Medium Priority
?
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 200 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 400 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 400 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

722 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