I am programming an application that gets information of a company contract. The process is:
1- Connects to an XML web service to get data about a contract.
2- Makes an SQL database insertion with this information.
3- Opens Excel to do insertions and read outputs from a document.
4- Closes Excel
5- Shows information in a datagrid in the Windows Form.
When I run the process to get information for one contract, everything works fine. However, now I need to get information from multiple contracts, so I added a timer that fetches every contract in a listbox, runs the process for all contracts, waits 5 seconts and then repeats it again and again.
The application is hanging and crashes, no errors, it just hangs with the sandclock icon and stops working.
I was wondering if anyone had a clue on how to avoid this, maybe refreshing the form after every timer cycle? Code is big and divided in several classes so posting it here might be tricky.