MDI App and Data Adapters

S

STom

I have an MDI application that basically is designed based on a
Model-View-Controller architecture. I have one controller class that will
contain the dataset that is viewed by all the forms.

The data model consists of a table that has its ID as a foriegn key in 5
other tables. It is a one to many relationship meaning the child tables can
have many records where this foriegn key is repeated several times.

I have a lack of experience using data adapters and I have gotten some help
on this forum before in this regard but I am still stuck on a few points.

1. It is easy enough to write a single stored procedure that returns back
multiple result sets for all the child tables given a specific ID, and I
could have a single data adapter to do this but would it not be better to
have a data adapter for each table, each adapter having its own select,
insert, update, delete commands? Since each table has different update,
insert etc requirements, seems to me this would be best. I could combine the
results of my fill statements into a single dataset. (The Update and Insert
commands will require stored procedures with parameters)

2. When I go to save my data in the datasets, I have been told that I only
need one 'properly configured' data adapter. I have seen examples where the
Update command was within the same function as the Fill command, but in my
case, I will have already used and deleted my adapter objects used to get
the data. How will I configure this new data adapter to have it know how to
call the datasets InsertCommand, UpdateCommand etc?

3. Do I need to need to create relations for the multiple datasets being
returned in order for the Update function to work correctly? What advantage
is this to me within the application?

Thanks for any pointers.

STom
 
S

STom

Never mind...I figured out what I needed to do with the adapters by creating
separate Select, Insert update and Delete commands for them.

STom
 

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

Top