multiple datasets/one dataset?

D

DKode

I have decided to try to have my data layer project datasets to my
business layer in a new app I am developing to see how it will work
out.

I have one question tho regarding datasets/datatables...

What is the significance of having all of my tables in one dataset vs.
seperating it out to have one datatable per dataset? is there an
advantage to doing this? and if so should I seperate out the datasets
depending on when I will need what tables information? Sometimes I
will need to only get one table out of six, sometimes i will need to
get all six tables.

is there any considerations i should be applying here during the
design phase of my application?

thank you.

DKode
 
S

Scott M.

If you have relationships between different tables, you'll want to have the
different tables in one DataSet and set up DataRelations for that DataSet.
To put every table in its own DataSet defeats the purpose of DataSets, you
could just have many DataTables with no DataSet..
 
G

Guest

I would like to add to this though - though I agree that there is obviously no point in having one dataset per table, of you have multiple forms which each use a differing number of tables, is it wise to create a different dataset per form, or is it a better approach to just create one dataset with all of the tables in it populated when you initialise your app, and then just pass references to it to your different forms?

This would seem good in that with data binding, am I right in thinking that changes that were made in one form, would then be reflected in other forms that referenced the same data?

How exactly does the concept of a data access layer fit in with all of this? Would a dal simply create the dataset and then return references to it, and similarly take modified datasets and propogate them back to the database?
 
S

Scott M.

Pete Fuller said:
I would like to add to this though - though I agree that there is
obviously no point in having one dataset per table, of you have multiple
forms which each use a >differing number of tables, is it wise to create a
different dataset per form,

Are we talking WinForms or WebForms here? It all would come down to what
level of scope the data needs to have.
or is it a better approach to just create one dataset with all of the
tables in it populated when you initialise your app, and then just pass
references to it to your >different forms?

Same as above.
This would seem good in that with data binding, am I right in thinking
that changes that were made in one form, would then be reflected in other
forms that referenced the same data?

Yes.
How exactly does the concept of a data access layer fit in with all of
this? Would a dal simply create the dataset and then return references to
it, and similarly take modified datasets and propogate them back to the
database?

The DAL would recieve data from another layer and place that data into the
DataSet (probably via a custom business object). The layers outside the DAL
would not ever see or interact with the DataSet, they would just pass data
into in and/or recieve data from it. A DataSet has getXML and readXML
methods, which are perfect vehicles to use in this regard.
 

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