Solved

Window Freeze Problem

Posted on 2008-10-24
4
187 Views
Last Modified: 2013-12-17
i'm creating a desktop applicatin which will store data on server
when i'm trying to upload data on server  and when i'm move on another application and come back again my application, my application is freeze & after uploading my application is normal.  

plz help me to solve this freeze problem..
0
Comment
Question by:ranjeetcode
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 19

Accepted Solution

by:
drichards earned 63 total points
ID: 22794187
It appears that your upload function is blocking the rest of the app.  You should look into doing the upload on a background thread if that is the case.  Look at the BackgroundWorker class

http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

and the ThreadPool class:

http://msdn.microsoft.com/en-us/library/system.threading.threadpool.aspx

Which one you want depends on your needs.
0
 
LVL 10

Assisted Solution

by:oxyoo
oxyoo earned 62 total points
ID: 22794198
This is due to the fact that you are executing the lengthy DB operation on the same thread that the UI uses to update the application.

When you want to perform lengthy tasks, like updates to DB, you should perform these tasks in another thread.

One way to accomplish this is to use the BackgroundWorker, here's some links for you:

Using Background Worker Component in Windows Forms
http://dotnetslackers.com/ASP_NET/re-27405_Using_Background_Worker_Component_in_Windows_Forms.aspx

BackgroundWorker Thread Use
http://dotnetperls.com/Content/BackgroundWorker-Introduction.aspx

BackgroundWorker Class
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx


Good Luck!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

689 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question