you need to index the tables collection in dataset.
dataset.tables(0) for the first table
dataset.tables(1) for second table
Main Topics
Browse All TopicsI am trying to automate the creation of a Database and all it's parts for my application, through code. In one instance I need to examine information returned from the SP_HELPLOGINS stored procedure. In Query Analyzer, I get two tables returned as it should be. When I run the same code in VB and fill a DataSet using a DataAdapter, it only returns the 1st of the two tables. I need access to the second table. I could have sworn I had this working before in a previous application (and yes I am reusing the same class)...
When I had written this class initially years ago, we were using SQL 2000. This new application I am creating uses SQL 2005. Is there a different behavior between Servers? Is there something I need to add to my code to get my DataSet to populate BOTH tables into it from SQL 2005?
Thank you in advance for any help you can offer...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Yes, through the debugger I checked through the visualizer, and also through manually sifting through the DataSet properties using the watch window. This is why I say I know it's returning only one(1) table.
I am also tracking down another avenue... I am using a Derived DataSet & DataTable in my application in order to encapsulate and enhance the interactions between DataSet to DataTable to DataRow. The problem might be in the Derived Class itself... I am thinking the way the Derived Class was created wasn't 100% correct and left some gaps in how data linked between DataSet -> DataTable -> DataRow... Unfortunately, until I gain some more information on how to "properly" inherit a DataTable and all it's constituent parts, I cannot say for sure whether this is my error or not.
Business Accounts
Answer for Membership
by: GiftsonDJohnPosted on 2009-04-07 at 11:45:14ID: 24090512
Hi,
et1.Tables [1];
If your stored procedure returns 2 tables from sql server then definitely the DataSet will have both the tables in it after getting filled.
To access the second table you have to use
GridView1.DataSource=DataS
GridView1.DataBind();
You can verify this by placing a breakpoint in the code and view the dataset in DataSet visualizer.