Table Adapters Vs Data Adapters

DekaFlash

Well-known member
Joined
Feb 14, 2006
Messages
117
Programming Experience
1-3
I have to access a SQL Database using a vb.net (net 2) winforms application.

Would you recommend using table adapters or data adapters?

Thanks
 
Read this:
http://www.vbdotnetforums.com/showthread.php?t=3051

Then you'll understand:

TableAdapter is a device that wraps a DataAdapter for the purposes of encapsulating code, isolating data access layer and providing an easy one-point design and build area for the data layer, type specific to the table it is designed to fill.
DataAdapter is a generic device that wraps a DataReader for purposes of pushing data between a generic datatable and a database. Generic is generally bad because it's hard to work with. It would be like Dimming all your vars as strings and converting them to numbers or dates when you wanted to add them up. We dont do that, we use type specific containers for data
DataReader is the lowest level of database access possible, used when some certain situations call for firehose access without the overheads of inmemory retention.

Simple answer without much reading: Then, use TableAdapters, occasionally deferring to DataAdapters when the need arises (very rare, e.g. attaching to a datasource that cannot be attached in the designer such as using the Jet driver in text mode to read an html based Excel spreadsheet - an exaqmple I encountered recently)


For info on how best to use TAs, read hte DW2 link in my signature
 
Back
Top