Solved

Best Practice - Table Adaptors

Posted on 2011-09-09
4
360 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

10 Experts available now in Live!

Get 1:1 Help Now