Solved

Best Practice - Table Adaptors

Posted on 2011-09-09
4
367 Views
Last Modified: 2012-05-12
I would just like to ask the experts here on the exchange how they prefer to setup their Dataset/TableAdaptors.

I was following along here....

http://msdn.microsoft.com/en-us/library/aa581778.aspx

... and it looks as though the author of this article places all his Tables into a single DataSet.xsd file.  So he has a single Northwind.xsd file and he places 4 table adapters within the DataSet.

Is this practical for larger scale applications?  

I have 30+ tables in my Database and I'm wondering if it makes more sense to have individual DataSet.xsd files for each Table versus having a single xsd file with 30+ adaptors in it.

I'm really just wonder what you guys do and how you handle situation like mine.

Thanks!
0
Comment
Question by:cdemott33
  • 2
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36513439
I do not like typed datasets at all. I use plain DataTable most of the time and only use a Dataset when I am dealing with multiple related datatables.
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 36514860
The role of the DataSet is to reproduce a subset of your database, relations and all, in memory.

A DataSet is thus a collection of tables with relations. The role of the Dataset is to manage those relations. A DataSet with only one table is one of the stupidest things that exist, but unfortunately, we see those popping everywhere.

If you are manipulating a lot of tables, but there is no relation between them, a DataSet is a useless collection of individual tables. A lone TableAdaptor for each table is then the way to go.

------ BUT ------

CodeCruiser is absolutely right.

I would even go further, Typed DataSets and TableAdapters are useless pieces of junk. Yes, they appear useful at first sight. And they are already obsolete. Do you know that (i might be off by one version for the following, but the idea is there).

Typed datasets appeared in Visual Studio 2002.
In Visual Studio 2005, they were replaced by Table Adaptors.
Then came Visual Studio 2008, where LINQ was supposed to be a lot better.
But in Visual Studio 2010, every one (Microsoft first) is yelling that you should use Data Entities instead.
From what we see now, this will still hold in 2012. Ouf, a little reprise.
But god knows what will replace Data Entities in 2014.

And could we got further back by telling about the precursors of those "do it fast" database technologies? The DAOControl of VB3 what replaced by the ADOControl in VB4, and this one did not make it to .NET.

DataTable where there in 2002, 2003, 2005, 2008, 2010 and will still be there in 2012. They won't disappear, because they are the basis of all the other technologies.

Instead of working with things that seems very easy to use but get replaced everytime there is a new version of the framework, all of which are simply a cover over DataTables, why don't you go straight to the core. It takes a little more code, I agree. But you have more control over what is happening. And over the years, you always work with the same technology, so you learn to master it. This beats having to learn a new technology every 2 years, having to change to a new one once you start to master the previous one. And once again, remember that all those technologies are but a front over the basic : the DataTable.

Work just a little more now, so that you do not have to work a lot later trying to debug things whose inner working is hidden from you. Work just a little more now so that you won't have to master 5 different technologies to understand an application that has evolved through all those stupid tools. Go for the DataTable.

Editorial by Jacques Bourgeois alias James Burger.

0
 

Author Comment

by:cdemott33
ID: 36520461
Hi James - Thank you so much for your feedback.  Can you recommend a good article(s) that provide excellent tutorials for creating DataTables?
0
 
LVL 40
ID: 36520611
Hi cdemott33.

I learned from the framework documentation and trial and error some 12 years ago, so I do not know of a good article. I could search for you, just as you could search yourself. But not knowing you, you would be better than me at finding an article suited to your level of expertise and you background.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now