troubleshooting Question

more bgw help

Avatar of sirbounty
sirbountyFlag for United States of America asked on
.NET ProgrammingVisual Basic.NET
12 Comments1 Solution342 ViewsLast Modified:
When my 'update' button is clicked, I'd like to run two simultaneous SQL update calls (to separate fields).
I have the following code, but (1) want to shorten it, and (2) want to include an overall 'if both are done then...' section.

I placed a class-level boolean thinking I could do it that route, but now I'm second-guessing myself...

Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
 Dim bgwE, bgwLB As New BackgroundWorker
 AddHandler bgwE.DoWork, AddressOf bgwEWork
 AddHandler bgwE.RunWorkerCompleted, AddressOf bgwEDone
 AddHandler bgwLB.DoWork, AddressOf bgwLBWork
 AddHandler bgwLB.RunWorkerCompleted, AddressOf bgwLBDone
 bgwE.RunWorkerAsync()
 bgwLB.RunWorkerAsync()
End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros