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?
 
Back
Top