Hi,
Need help on how to use .Net's Backgroundworker thread for the following purpose to increase UI responsiveness and performance in my .Net winforms application.Since am new to .Net/C#, any code would be helpful.
When user clicks "Calculate" button in UI form,
1.Get a list of categories C from database[this is typically around 10]
2.For each category C, do the following:
a.Call a third-party library, do some processing and calculate category price.
b.Get a list of products[This is typically around 800].
c.For each product, calculate its price using its category price from above.
d.Update this price of each product back in the database using a stored proc.
3.Update the progress back[or report any error message] to a form in UI.
I want to use Backgroundworker for steps #c and #d above. So, where do I make a call to InitializeBackgroundworker and RunWorkerAsync?
Also, how do I make sure these 2 methods get called for each category?
Thanks for reading.