OleDbDataAdapter vs OleDbCommand

D

darrel

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
 
S

Scott M.

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.
 
S

S.M. Altaf [MVP]

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.
 
S

Scott M.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top