DataAdapter.Update

  • Thread starter Thread starter Sudhesh
  • Start date Start date
S

Sudhesh

Hi,

Can anyone shed some light on which of the two is more efficient (if at
all) and why?

Scenario A: I have setup the Select, Insert, Update & Delete commands
of a DataAdapter, using Stored Procs (against SQL server). Then I call
the Update method.

Scenario B: I loop through each datarow and call the appropriate stored
procs myself.

Is there a better way to send a whole bunch of rows to SQL server with
less round trips?

Cheers
Sudhesh
 
If you built the SQL statements dynamically and sent all updates in one call it would run faster.
 
As long as you simply loop through the datarows and set the appropriate parameter values, while reusing the same insert, update, and delete command objects, it should be the same as if you have the DataAdapter do it for you. What extra work do you think the adapter does?
 

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

Back
Top