Visual Basic.NET
  Home arrow Visual Basic.NET arrow Developing Long Running Tasks Using Asynch...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Developing Long Running Tasks Using Asynchronous Programming with VB.NET 2005
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 15
    2006-07-31

    Table of Contents:
  • Developing Long Running Tasks Using Asynchronous Programming with VB.NET 2005
  • What exactly is the problem?
  • The solution is here
  • The asynchronous way of dealing with a long task

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Developing Long Running Tasks Using Asynchronous Programming with VB.NET 2005


    (Page 1 of 4 )

    This article gives you a practical understanding of asynchronous programming. It also gives you a simple template for developing asynchronous-based applications in a very easy manner.
    A downloadable file for this article is available here.

    For this article, I assume that you know enough of the basics for working with VB.NET controls, threading, events and delegates, ADO.NET, and so forth using Visual Basic.NET 2005. The entire source code for this article is available in the form of a downloadable zip. The solution was developed using Microsoft Visual Studio 2005 Professional Edition with Microsoft SQL Server 2005 Developer Edition on Microsoft Windows Server 2003 Enterprise Edition. 

    Even though I believe that the source code available with this contribution can work with Microsoft Visual Studio.NET 2003/2002, I didn’t really test it in any other environment. I request that you post in the discussion area if you have any problems with execution.

    Methods of presenting long running tasks

    When we develop any Windows-based application, we generally deal with the existing VB.net controls. For further flexibility, we may even use a few third party controls/components out of necessity.

    When we develop applications which do heavy processing like scientific calculations, backing up/restoring a database, multi-level cross-tab reporting, summarizing data, file/directory search, and so forth, we are required to inform/display the status to the user, so he or she can see what our application is currently doing.. 

    If we develop the application without showing the status of the process to the user, it would not be a very pleasing application. In some scenarios, some developers simply use the “Please wait” message. Even though this is better than nothing, it seems to work best for very short processing times (roughly three to four seconds).  Imagine developing an application which processes a task for an hour, and shows a "Please wait" message for that entire time! Certainly, most users would not be pleased.

    A better method would be to use a label/text area/list box/list view/status bar to show the latest status of the process. In the case of a label, it can only show the latest status of the process. The best example for this would be a file/directory search. A text area/list box/list view may be used when you want to show each and every status of the process (history) by adding the latest status at the end.  You might want to use this method for CD burning software. A status bar might be used when you are dealing with a process that requires a small number of steps, but it may not be eye catching. One example of this is Yahoo/MSN messenger.  To make the status bar eye catching, these IM programs are equipped with beautiful icons, to let user know the status.

    Another method of showing the status of a process would be using a “progress bar.” It is really eye catching for the user. The user would certainly appreciate it, if it is available. Some CD/DVD burning software include all of the above methods together in a synchronized and effective manner (along with text indicating the expected time to finish). 

    The ultimate goal for any application developer would be making the user happy, even during long-running applications.

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · hello guys. This contribution introduces you to work with long running tasks. enjoy...
       · I have code in which i need to enable a cancel button during a process.Right now i...
       · In Vb, you can use the same code that is called when the task starts to make sure it...
       · If you don't add "application.DoEvents" to the ExecuteTask Sub, the system will hang...
     

    VISUAL BASIC.NET ARTICLES

    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...
    - Movement and Player Statistics in a VB.NET T...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek