how to run progress bar while executing a long method or an update statement?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tskmjk
    New Member
    • Oct 2008
    • 3

    how to run progress bar while executing a long method or an update statement?

    Hi,

    I am unable to crack this as the end user requested to show some kind of progress bar while running a long time method or an update statement. Kindly suggest me on this ASAP.

    Rgds,
    TSKMJK
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    I am unable to crack this
    Obviously you have already been working on this. What do you have so far?

    Comment

    • tskmjk
      New Member
      • Oct 2008
      • 3

      #3
      Hi,

      I have developed a vb.net application with MySQL as backend. Its a data massaging tool where it takes excel sheet as input and processes its data. During this long operations, end user asked to have a progress bar so that the progress can be known. But I am unable to do this as its a series of update sql statements which takes a long time and I am unable to run progress bar for this.

      Kindly help

      Rgds
      TSKMJK

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        The long executing process should be run in a seperate thread.
        Then you are free to update the progressbar as you like.
        I recomend incrementing the bar by "task" and not by time. Much easier to estimate that way.

        Comment

        • tlhintoq
          Recognized Expert Specialist
          • Mar 2008
          • 3532

          #5
          If the processing is being handled by a program you wrote and are in control of, you could add an event that gets raised during each pass. That way your progress bar can receive the event and update.... 154 of 12,000 .....

          But if the process is all contained in the MySQL database... I don't know what to tell you. Processing is happening inside a closed system.

          Originally posted by tskmjk
          this as its a series of update sql statements
          Originally posted by Plater
          I recomend incrementing the bar by "task" and not by time.
          If you are in control of the series of SQL statements (each statement comes from your program, then Plater's suggestion makes the most sense.... Step 1 of 5....

          Comment

          • Curtis Rutland
            Recognized Expert Specialist
            • Apr 2008
            • 3264

            #6
            I suggest you use a BackgroundWorke r to handle your long database commands. That way, the UI thread isn't blocked and you can update graphical elements.

            Comment

            Working...