Hi Guys I have a winform which acts as an interface for a database. At some point the user will select a directory which contains 30 to 40 files. These files will have to be inserted into the database as raw data. That is as is. Then that raw data will interrupted and fixed up. Once this is done the user can dump the fixed data to one excel file. This works perfectly when I am running it in visual studios in release or debug mode. However when I try to run it form outside of visual studios (that is from the bin / release file) it stalls then becomes non-responsive. I and the user don’t mind if it becomes slow (about 60 thousand records are printed). However why does it stop working. I figured the part where it stops responding and it doesn’t seem like its deadlocked? Any ideas of how to improve it would be appreciated. I also requested that my application runs with high priority but that still doesn’t help.
Share
You need to do all that processing in a separate thread. I would recommend using the BackgroundWorker.
Here is information about the class – http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx
Here is an example of how to use it – http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-winforms-using-the-backgroundworker-class/