how to display the progress bar until sql procedure running in vb.net?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bluesathish
    New Member
    • Mar 2010
    • 22

    how to display the progress bar until sql procedure running in vb.net?

    Dear All,
    I want to display the Progress bar control in my vb.net application until my procedure runs at the backend. Please anyone help me to do this.


    Regards,
    Bluesathish
  • Crusader2010
    New Member
    • Nov 2011
    • 13

    #2
    Read on the Backgroundworke r and you should be able to do it yourself. Some tips:

    In the DoWork event run your procedure and call ReportProgress with a value related to how much of your data was loaded compared to the total amount (basically a percentage), and as well send any value you might also need(UserState parameter).

    In the ProgressChanged event adjust the progressBar1.Va lue to the percentage(or a variation of it based on progressBar1.Ma ximum), by using e.ProgressPerce ntage, as well as do anything with the value from e.UserState if you need to.

    In the RunWorkerComple ted event you can put the value of the progress bar to its maximum or display a message box that loading the data has finished, or whatever (like hide the progress bar).

    Hope this helps

    Comment

    • sirasingh
      New Member
      • Nov 2011
      • 2

      #3
      You can call report progress or even you can set the progress bar with timer.
      If ProgressBar1.Va lue <= 32 Then

      Label7.Text = "Initializing.. ..."

      ElseIf ProgressBar1.Va lue <= 52 Then

      Label7.Text = "Loading components..... "

      ElseIf ProgressBar1.Va lue <= 72 Then

      Label7.Text = "Integratin g Database...."

      ElseIf ProgressBar1.Va lue <= 100 Then

      Label7.Text = "Please wait..."

      End If

      If ProgressBar1.Va lue = 100 Then

      Timer1.Dispose( )

      Me.Visible = False

      Dim cur As New FrmLogin()

      cur.Show()

      End If
      Last edited by Niheel; Dec 20 '11, 03:29 PM.

      Comment

      Working...