Update progress bar to reflect database update?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pierre

    Update progress bar to reflect database update?

    Hi, I was wondering if anyone ever done a progress bar that reflects a
    database update. I have an update query with SQL server that takes
    about 5 minutes. I can't figure out a way to show the progress of the
    update in a progress bar since I have no idea how much time it will
    take. Anyone ever done this??
  • Ken Tucker [MVP]

    #2
    Re: Update progress bar to reflect database update?

    Hi,

    The dataadapter has the rowupdating, and rowupdated events. Maybe
    you can use one of them to update a progressbar.



    Ken
    ---------------
    "Pierre" <pietrud@hotmai l.com> wrote in message
    news:903caf70.0 402241117.20a88 263@posting.goo gle.com...[color=blue]
    > Hi, I was wondering if anyone ever done a progress bar that reflects a
    > database update. I have an update query with SQL server that takes
    > about 5 minutes. I can't figure out a way to show the progress of the
    > update in a progress bar since I have no idea how much time it will
    > take. Anyone ever done this??[/color]


    Comment

    • Bernie Yaeger

      #3
      Re: Update progress bar to reflect database update?

      Hi Pierre,

      I do exactly what you're trying to do. I use the datatablerow_ch anged
      event. First, create your pbar; then add this code before calling
      performstep:
      AddHandler dt.RowChanged, New DataRowChangeEv entHandler(Addr essOf
      DataTableRow_Ch anged)

      The code of the event is as follows:
      Public Sub DataTableRow_Ch anged(ByVal Sender As Object, ByVal e As
      System.Data.Dat aRowChangeEvent Args)

      ' The DataRow has changed. update pbar2

      glf_icount += 1

      If glf_icount > (pbar2.Maximum / 100) Then

      glf_icount = 0

      pbar2.PerformSt ep()

      Application.DoE vents()

      End If

      glf_totalcount += 1

      prglabel.Text = glf_totalcount

      End Sub

      HTH,

      Bernie Yaeger

      "Pierre" <pietrud@hotmai l.com> wrote in message
      news:903caf70.0 402241117.20a88 263@posting.goo gle.com...
      [color=blue]
      > Hi, I was wondering if anyone ever done a progress bar that reflects a
      > database update. I have an update query with SQL server that takes
      > about 5 minutes. I can't figure out a way to show the progress of the
      > update in a progress bar since I have no idea how much time it will
      > take. Anyone ever done this??[/color]


      Comment

      • Pierre

        #4
        Re: Update progress bar to reflect database update?

        Thank you very much to you both, this is exactly what I need thanks again!

        Comment

        Working...