Design Question

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hi,

Newbie to ADO.NET here.

I have a VB.NET client program that will communicate with a SQL
Server database. The database consists of one master (parent) table
and 12 detail (child) tables. All of this data will be edited from a
single form - each detail table will have its data on a separate
tabsheet in the form.

In my VB.NET client would it be better to have one dataset with
all of the tables modeled as datatables inside of that dataset, or
would it be better to have each table in its own dataset - so 13
datasets?

Joe
 
If the data is related, which you imply it is by calling them child
tables, then one dataset is the way to go.

T
 
Joe: There are several issues most of which are touched upon in this thread
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2630471&SiteID=1

In general, I agree that one dataset is the way to go. There are several
issues, maintainability, performance, etc. One dataset is usually the best
approach for this.

however, there's no rule that says you have to use Datasets at all.
Frameworks such as the CSLA www.lhotka.net/cslanet/ don't use them in many
cases. If you are planning on pulling the data down, editing it, then
sending it all back to the database, then the dataset model is excellent.
But you may need to have your updates sent back more quickly, you may want
the changes to be sent back immediately. In such cases, you can just grab
the values from yoru objects and pass them into a stored proc or sql
statement.

The dataset model works best if you need to enforce logic such as foriegn
key relationships or the like. You can use the Expression property of the
DataColumns to handle computed columns. If you don't need this
functionality though, then you can easily use a design that just uses pure
business objects in it. Note though that in no way am I downselling
datasets, just bringing up some of the nuances in a design decision. And in
most cases, and from the sounds of your needs, one dataset with several
tables will do just fine.
 
Back
Top