?
Solved

Window Freeze Problem

Posted on 2008-10-24
4
Medium Priority
?
188 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 252 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 248 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

Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

Question has a verified solution.

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

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

762 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