How can one cancel an already running TableAdapter.Update()
call? I'm calling it inside an SqlTransaction
and can therefore easily call Rollback()
on the transaction, but that doesn't stop the execution of Update() itself.
Note: I'm running Update()
on a BackgroundWorker in case you're wondering how do I call Rollback()
during another executing function.
So I solved this by using the TableAdapter.Update(DataRow r)
overload and sending it one row at a time. This way if I need to cancel the operation at some point, I can simply break the loop and roll back my transaction. Easy, isn't it?!