Groups | Blog | Home
all groups > dotnet faqs > november 2005 >

dotnet faqs : OleDbDataAdapter vs OleDbCommand


darrel
11/23/2005 1:41:37 PM
When retrieving data, I typically use an OleDbDataAdapter.

When updating data, I normally use an OleDbCommand. But it seems as if a
OleDbDataAdapter would work just fine too.

What is the general rules of thumb for using one over the other for a given
DB query?

-Darrel

Scott M.
11/24/2005 12:00:00 AM
DataAdapters only work because of Command objects that it wraps around.

What's nice about DataAdapters is that they have the ability to invoke the
correct Command with simple method calls. In other words, they are a
convienience. There are no rules of thumb for their use.

[quoted text, click to view]

S.M. Altaf [MVP]
11/25/2005 12:00:00 AM

It'd all be on personal preference and the architecture of the application.
When using all SPs for data retrieval, for example, you wouldn't use any
dataadapters.

--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com


[quoted text, click to view]

Scott M.
11/25/2005 10:37:55 AM
Well, sure you could use DataAdapters with SP's, the commands would just be
configured to a storedproc commandtype, just as you'd need to do without the
DataAdapter.

SP's don't really make any difference in determining if you should use a DA.
The DA still provides the "automatic" execution of the correct command
object based on changes made to the local dataset.



[quoted text, click to view]

AddThis Social Bookmark Button