In a sample on MSDN you can learn how a BackgroundWorker operates:
How to: Run an Operation in the Background[
^]. The
DoWork
and
RunWorkerCompleted
event handlers you'll hook up to the backgroundworker will do the brunt of the work. You'll have to make sure though that the processing and/or save method is encapsulated in a class you should define. That way you won't pollute your code and everything is neatly separated. It will also make it easier for you to track the progress of the processing and saving in the front end, especially when there is more than one process going on at any one time.
Regards,
Manfred