Up to this point, I have avoided using the Data Adapter to do my updates back
to the database. I found it more straight forward to build my own SQL
statements, and just execute them directly.
I'm starting to see the light and have some good reasons I may start using
the DataAdapter and utilizing it's update functionality.
In reading up on this it APPEARS that EACH row of a data table that has been
changed makes a SEPARATE call back to the database. Therefore, if you had a
1000 row table, and changed a field in every row, DataAdapter.Upd ate would
make 1000 separate runs to the database.
Is this right? I can understand why this might be, as it gives quite a bit
of control to the developer, but from an efficiency point of view, it's crazy.
Should I first test to see how many rows have been updated, and if it is
over a dozen or so, go back to my creating my own SQL statement so it can get
sent all at once?
OR, is there some sort of method I have not yet discovered that allows the
1000 update statements to be created as a single string that I can manipulate
and call in a bulk statement?
Just looking for some comments, feedback, and ideas.
--
--Zorpie
to the database. I found it more straight forward to build my own SQL
statements, and just execute them directly.
I'm starting to see the light and have some good reasons I may start using
the DataAdapter and utilizing it's update functionality.
In reading up on this it APPEARS that EACH row of a data table that has been
changed makes a SEPARATE call back to the database. Therefore, if you had a
1000 row table, and changed a field in every row, DataAdapter.Upd ate would
make 1000 separate runs to the database.
Is this right? I can understand why this might be, as it gives quite a bit
of control to the developer, but from an efficiency point of view, it's crazy.
Should I first test to see how many rows have been updated, and if it is
over a dozen or so, go back to my creating my own SQL statement so it can get
sent all at once?
OR, is there some sort of method I have not yet discovered that allows the
1000 update statements to be created as a single string that I can manipulate
and call in a bulk statement?
Just looking for some comments, feedback, and ideas.
--
--Zorpie
Comment