Solved

DataAdapters vs. TableAdapters

Posted on 2008-10-07
1
983 Views
Last Modified: 2012-05-05
DataAdapters vs. TableAdapters
0
Comment
Question by:JPTenore
1 Comment
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
Comment Utility
If you're not sure whether to use a TableAdapter or a DataAdapter, this tells you which one you should use:

The typical Visual Studio mechanism for executing Transact-SQL queries and for filling datasets is the TableAdapter.

You can execute SQL statements or stored procedures against a data source using TableAdapters or command objects (for example, SqlCommand). To load data into datasets created using design tools in Visual Studio, use TableAdapters. To load data into datasets created programmatically, use data adapters. If your application does not use datasets, use command objects to execute SQL statements or stored procedures directly against a database.

If you create a dataset with a Visual Studio design-time tool (such as the Dataset Designer or the Data Source Configuration Wizard), then you use a TableAdapter to fill it. TableAdapters execute your SQL statements or stored procedures.

If you create a dataset without design-time tools, then you must use data adapters to fill and update data. (TableAdapters are not actual classes in the .NET Framework, so they are not suitable for working with datasets that have been created without the use of design-time tools. For more information on loading data into datasets with either TableAdapters or data adapters, see How to: Fill a Dataset with Data.


The DataAdapter is the abstract/mustinherit class from all DataAdapters. In that are the SQLDataAdapter and the OleDBdataadapter.

The table adapters are strongly typed derived classes from those, they are used with strongly typed datasets and have extra methods in them.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

17 Experts available now in Live!

Get 1:1 Help Now