Solved

Window Freeze Problem

Posted on 2008-10-24
4
186 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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