I am running a BackgroundWorker to make a call to a Web Service to obtain a list of Customers, and a list of Vat Rates. This is fine and works, but I am simply stuck passing this data through to RunWorkerCompleted so the form can be updated (these two sets of data populate two combo boxes)
private void bwWebServiceCalls_DoWork(object sender, DoWorkEventArgs e)
{
//Get customers
Invoice.Customer[] customers = new Invoice.Customer[0];
customers = this.wsInvoice.getCustomers("user", "pw");
//Get Vat Rates
Invoice.Vat[] vats = new Invoice.Vat[0];
vats = this.wsInvoice.getVatRates("user", "pw");
e.Result = ;
}
This is incomplete code! If anyone can point me in the right direction on how to send the two objects (customers and vats) through e.result, and how to split these out in RunWorkerCompleted it would be very much appreciated.
I have thought about running two BackgroundWorkers (one for each) as I have done this singulaly, buy am worried that it would result in two WebService calls, and is not as neat as it could be.
If I am completely on the wrong track, again any pointers would be great.