Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Using the progress bar control to track database activities

Using the progress bar control to track database activities

Scheduled Pinned Locked Moved Visual Basic
databasequestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robotovich
    wrote on last edited by
    #1

    I am selecting and inserting large amounts of data into a SQL database and I would like to inform the user of the progress. How do i do this using a progress bar or something similar.

    S C 2 Replies Last reply
    0
    • R Robotovich

      I am selecting and inserting large amounts of data into a SQL database and I would like to inform the user of the progress. How do i do this using a progress bar or something similar.

      S Offline
      S Offline
      Stephen McGuire
      wrote on last edited by
      #2

      Do you have some kind of looping structure for selecting and inserting records? How do you do it? When I know, it will be easier to explain how you would implement the progressbar. Steve

      R 1 Reply Last reply
      0
      • R Robotovich

        I am selecting and inserting large amounts of data into a SQL database and I would like to inform the user of the progress. How do i do this using a progress bar or something similar.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        In order to do this, you would need to do lots of little inserts, instead of one big one. This will slow down the overall process considerably. If you're stuck with doing it this way, then implimenting a progress bar is trivial. If you're not, I can't see a way to do it without slowing things down.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        R 1 Reply Last reply
        0
        • S Stephen McGuire

          Do you have some kind of looping structure for selecting and inserting records? How do you do it? When I know, it will be easier to explain how you would implement the progressbar. Steve

          R Offline
          R Offline
          Robotovich
          wrote on last edited by
          #4

          I am selecting and inserting arge amounts of data into a SQL database. In terms of the inserting i have a solution i think i can work with. I will simply get the count of the number or records in the dataset and set the progress bar max value to this. I will then increment the progress bar counter each time a record is added. The problem is liking the progress bar to the selection process. When I am retrieveing these thousands of records from the databse I wamt to inform the user what percentage of records have been retrieved so far. Is there any way to know what percentage of records have been retrieved so far.

          S 1 Reply Last reply
          0
          • C Christian Graus

            In order to do this, you would need to do lots of little inserts, instead of one big one. This will slow down the overall process considerably. If you're stuck with doing it this way, then implimenting a progress bar is trivial. If you're not, I can't see a way to do it without slowing things down.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

            R Offline
            R Offline
            Robotovich
            wrote on last edited by
            #5

            How do I track the amount of records recieved so far by a select statement?

            1 Reply Last reply
            0
            • R Robotovich

              I am selecting and inserting arge amounts of data into a SQL database. In terms of the inserting i have a solution i think i can work with. I will simply get the count of the number or records in the dataset and set the progress bar max value to this. I will then increment the progress bar counter each time a record is added. The problem is liking the progress bar to the selection process. When I am retrieveing these thousands of records from the databse I wamt to inform the user what percentage of records have been retrieved so far. Is there any way to know what percentage of records have been retrieved so far.

              S Offline
              S Offline
              Stephen McGuire
              wrote on last edited by
              #6

              Well, if you know the total of records in the first place, just divide this by 100. The you could do something like this: Value = CInt(TotalRecords/100) 'Equals 1% Add a handler for the RowChanged event of your table(s). Then in the RowChanged events: Check for: e.Row.RowState = DataRowState.Added and update a public counter... Check it against 'Value' and update the ProgressBar.Value when it meets the criteria you choose. Just one way to do it. It is going to slow down your inserts to some degree though... Steve -- modified at 15:43 Friday 18th August, 2006

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups