B
bill yeager
I need to update records in a database. In order to do
this, I'm performing a "delete" (on the original record)
and "insert" (on the new record) since the record I'm
deleting is part of the key. This is being done via
the "da.update(dt)" method. The first record is marked for
deletion and the second one for insertion from the
rowstate inside the datatable.
Another way is to make separate passes to the db creating
a transaction before the "delete" and commiting after
the "insert". However, because of the application logic,
this is not conducive to the scenario.
What I'd like to know is: "Do I need to encircle the
above "update" statement within a transaction or does .Net
do this for you automatically. The reason I'm wondering is
because the "update" statement will perform this step in
one db pass (although each row within the dataset actually
gets updated accordingly to the rowstate)...
this, I'm performing a "delete" (on the original record)
and "insert" (on the new record) since the record I'm
deleting is part of the key. This is being done via
the "da.update(dt)" method. The first record is marked for
deletion and the second one for insertion from the
rowstate inside the datatable.
Another way is to make separate passes to the db creating
a transaction before the "delete" and commiting after
the "insert". However, because of the application logic,
this is not conducive to the scenario.
What I'd like to know is: "Do I need to encircle the
above "update" statement within a transaction or does .Net
do this for you automatically. The reason I'm wondering is
because the "update" statement will perform this step in
one db pass (although each row within the dataset actually
gets updated accordingly to the rowstate)...