Ok, I was deciding between a thread or BackgroundWorker process and based on the responses from this thread I decided to go with the BackgroundWorker. Here is the thing though, when I started the worker process it stopped half way with a connection timeout error to the database. This is normal when the process is run directly on the DB server (4-5 mins) as I am talking a lot of invoices here. Anyways, I know I can adjust the connection string timeout, but has anyone run into similar issues? What's the average timeout used in these types of scenario?
I was thinking of creating a separate connection with a different timeout specially for this task. This invoice generating task will be ran by one person.