473,396 Members | 1,892 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,396 software developers and data experts.

getting multiple table results question using stored procedure

When i run the code below with stored proc :-

I get only the first table results :-"templates"
even if i fill the dataset with another table for example
category,pages etc..

Any ideas?

Store procedure below:-
------------------------
ALTER PROCEDURE dbo.webpage
AS
Select template_id,template_header,template_footer from templates
Select link_id,link_text,link_url from links
Select category_id,category_text,category_url from category
Select page_id,page_category,page_title,page_subtitle,pag e_text from
pages
RETURN
GO

Dim TreetableDataSet As DataSet
Dim TreetableConnection As SqlConnection
Dim TreetableAdapter As SqlDataAdapter
'Dim cmdcommand As SqlCommand

TreetableConnection = New
SqlConnection("server=(local);database=northwind;i ntegrated
security=true;")
TreetableAdapter = New SqlDataAdapter("webpage",
TreetableConnection)
TreetableDataSet = New DataSet
Try
TreetableConnection.Open()
TreetableAdapter.Fill(TreetableDataSet, "links")
TreetableDataGrid.DataSource = TreetableDataSet
TreetableDataGrid.DataMember = "links"
TreetableDataGrid.DataBind()
Catch TreetableException As SqlException
'TreetableExceptionLabel.Text = TreetableException.Message
Finally
TreetableConnection.Close()
End Try
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
2 2357
From the MSDN:

When the query specified returns multiple results, each result set is placed
in a separate table. Additional result sets are named by appending integral
values to the specified table name (for example, "Table", "Table1",
"Table2", and so on).

In your case you should find result set from table links under name
"links1", from category under "links2" and from pages under "links3". What
you get under name "links" is your result set from table templates since it
is the first one returned by the stored procedure.

Eliyahu

"Patrick Olurotimi Ige" <na********@hotmail.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
When i run the code below with stored proc :-

I get only the first table results :-"templates"
even if i fill the dataset with another table for example
category,pages etc..

Any ideas?

Store procedure below:-
------------------------
ALTER PROCEDURE dbo.webpage
AS
Select template_id,template_header,template_footer from templates
Select link_id,link_text,link_url from links
Select category_id,category_text,category_url from category
Select page_id,page_category,page_title,page_subtitle,pag e_text from
pages
RETURN
GO

Dim TreetableDataSet As DataSet
Dim TreetableConnection As SqlConnection
Dim TreetableAdapter As SqlDataAdapter
'Dim cmdcommand As SqlCommand

TreetableConnection = New
SqlConnection("server=(local);database=northwind;i ntegrated
security=true;")
TreetableAdapter = New SqlDataAdapter("webpage",
TreetableConnection)
TreetableDataSet = New DataSet
Try
TreetableConnection.Open()
TreetableAdapter.Fill(TreetableDataSet, "links")
TreetableDataGrid.DataSource = TreetableDataSet
TreetableDataGrid.DataMember = "links"
TreetableDataGrid.DataBind()
Catch TreetableException As SqlException
'TreetableExceptionLabel.Text = TreetableException.Message
Finally
TreetableConnection.Close()
End Try
*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #2
Eliyahu thanks for the response.
But can you explain in details or give me an example.
Thx

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #3

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

Similar topics

0
by: Golawala, Moiz M (GE Infrastructure) | last post by:
Hi All, Could someone please help me with an issue I am having. I am having problem returning values from a Stored Procedure that creates a dynamic table (table variable) inserts values during a...
7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
12
by: Scott | last post by:
Front-end Access 2000 I have a stored procedure that has 2 parameters BusinessUnitID and Year. It returns multiple record sets (5 to be exact). I thought I could use a Pass through query but...
20
by: p175 | last post by:
Hi people, I have a stored procedure that creates many Global temporary session tables. Into each of these tables go the results of various processing using relational division all keyed and...
6
by: Uday | last post by:
Hi everyone, I have a ASP page that triggers a db-side stored procedure. At the end of the procedure, it spits out a log file, that this ASP page reads and displays for the users. But the...
5
by: Wael | last post by:
Hi, I have the following stored procedure that does some processing and puts the result in a temporary table. I tried several things that procedure to display output that I can access with...
3
by: Otto Carl Marte | last post by:
Hi, As I understand it, Declared Global Temporary Tables (DGTTs) have a scope that is session/connection based. Using the same connection, I have discovered that if I declare a DGTT in one...
2
by: Andrew Cooper | last post by:
Greetings, I'm creating a website using ASP.NET. In creating my DAL I've got a Table Adapter that I've set up to use an existing Stored Procedure from an SQL Server 2000 database. However,...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.