My desktop application freezes while fatching data from external server
I am developing an application which has a feature to fatch the data from SAGE server using its own SAGE APIs. for more information regarding to this API, pls visit http://www.qti.com/kb/article_files/10288/XMLDataStreamDevelopersGuide.pdf
now the problem is, when i start fetching data from the server, its started working but the application is freezed until it fetches all the data from the server.
actually, this data fetching process is very long coz of bulky data. for ex. for the supplier's list, sage server sends more than 6000 records as response to any request.
so I want to show something processbar like thing but because of this freezing problem, i can not display that as whole application becomes unresponsive right after i click the fetch button untill all data fetching is completed.
plz suggest me something as soon as possible.
Thanks in advance
Kirtan PatelPosted Aug 28, 2009, 7:56 AM
You need to Create Multi Threaded Application
One Thread That is Main Thread Will Run the Application interface .
One For Fetching data From SAGE Server . and use Delegates to Perform Cross thread Operations if Interaction is There With Running Thread to GUI .
Now Your Application will not Freeze While Downloading Data From Server :)
Another Solution to your Problem is
Use background Worker Control that will handle Multi Threading if you Prefer to use it .
Kirtan PatelPosted Aug 28, 2009, 8:54 AM
Mohit ZinzuvadiaPosted Aug 28, 2009, 8:46 AM
Kirtan PatelPosted Aug 28, 2009, 8:26 AM
may be you can solve it with following link
http://support.microsoft.com/kb/826513
Try to Use Garbage Collectors may be it can help you to free up memory
GC.Collect();
Mohit ZinzuvadiaPosted Aug 28, 2009, 8:14 AM