Created Dataset with two tables - How do I populate at runtime?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In VS 2005, I created a dataset with the dataset designer that has two tables
that have a parent-child relationship (which I also added in the designer).
Each table gets data from a stored procedure. I want to populate the dataset
at runtime, passing in a parameter from another control on the form, then
pass the dataset to a crystal report. And that is what I haven't figured out
- how to populate the dataset at run time. Can someone point me in the right
direction?

thanks
 
There are a couple of ways.

1. Pass the DataSet to two different DataAdapters and let them populate each
table.
2. Get the data independently and "migrate" to the DataSet
3. Call a single sproc to fill both tables.

Of the options, I like three the best (one trip) in most cases. Fill the
parent before the child.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
 
thanks for the tip. I used Item 3 as you suggested, which worked like a
charm. I wasn't aware that I could do populate two tables in one dataset so
easily.
 
Unfortunately, the MS literature is WAY too focused on filling a single
table. Glad it worked for you.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
 
Back
Top