Fill dataset with multiple tables

  • Thread starter Thread starter Nikolay Petrov
  • Start date Start date
N

Nikolay Petrov

How to fill dataset with multiple tables and set their relaition?
Can I get the relations from the SQL server?
Also I would like to do it using stored procedures.

TIA
 
Hi Nikolay
You can just create tables fill them with data and add them to the tables
collection of your dataset . you can also create a Select command for you
dataAdapter that select more than one table and then use that fill method
of that dataAdapter against you dataset . this simply will fill the
dataset with all the table that you selected. If you want to do it with a
SP you can create that stored procedure that select more than one table.
then set the selectCommand type of the adapter to a SP and make it
reference your SP then use the fill method to fill your set will all the
tables. You can also create a typed set then from server explorer drag
all your database table to create a schema or the relational model of your
database with all its constrains
Hope this helps

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top