0

I have a background worker thats doing some database work for me. The reason why I resorted to using using the background worker is because the database work is taking up a lot of time. So the code work the first time but as you continue to update the database then then you get "Could not save; currently locked by another user. OledbException was unhandled". Is the a way to go around this issue. This is my code

Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
    DoSaveUsersAuditForUpdate_Click()
End Sub

And I am running it in my Update button click event using

  BackgroundWorker1.RunWorkerAsync()

how can I know

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by ChrisHunter
0

If there is already a background worker taking up the resources the lock will mean the new background worker wont be able to access the resource so you will have to put an action listener in to check when the resources become available.

Also try to make your queries more efficient to reduce execution time.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.