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. C#
  4. how can I show the search progress?!

how can I show the search progress?!

Scheduled Pinned Locked Moved C#
questioncsharphelp
5 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.
  • X Offline
    X Offline
    xkx32
    wrote on last edited by
    #1

    hi i am using c# and ms access and i have a search functionality in my app... i am wondering what's the concept behind showing the search progress by a progress bar? thanks for your help in advance

    E 1 Reply Last reply
    0
    • X xkx32

      hi i am using c# and ms access and i have a search functionality in my app... i am wondering what's the concept behind showing the search progress by a progress bar? thanks for your help in advance

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      If you have the number of items being searched then just use a progress bar with Maximum set to that value and set Value to the current index you're searching. If you don't know how many items you're searching then you're best of using the ProgressBar (in .NET 2) with Style set to Marquee which is an "infinite" progressbar.  If you're using .NET 1.x there are some articles here on CP which are to do with "Busy" bars which are essentially the same thing.


      As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it

      X 1 Reply Last reply
      0
      • E Ed Poore

        If you have the number of items being searched then just use a progress bar with Maximum set to that value and set Value to the current index you're searching. If you don't know how many items you're searching then you're best of using the ProgressBar (in .NET 2) with Style set to Marquee which is an "infinite" progressbar.  If you're using .NET 1.x there are some articles here on CP which are to do with "Busy" bars which are essentially the same thing.


        As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it

        X Offline
        X Offline
        xkx32
        wrote on last edited by
        #3

        Thanks but what index you're talking about? I'm using the LIKE clause to do a simple search...

        M E 2 Replies Last reply
        0
        • X xkx32

          Thanks but what index you're talking about? I'm using the LIKE clause to do a simple search...

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #4

          Please be more specific with your questions in the future or you'll get more answers you won't understand... I assume you're executing an SqlCommand (or something similar) that's taking some time and you don't want your UI to hang while this command is running, right? If this is the case, you could create a progressbar (infinite, like Ed.Poore suggested, since you don't know how long the command will run) and then execute the SqlCommand in a WorkerThread. That way your UI will remain responsive while the SqlCommand is being executed. Once the command has finished you'll have to signalize to your initial class that the progress bar can be removed and that the results can be displayed. If you're still unclear on how to do this, please google for the words written in code style to get more information on them (esp. WorkerThread).

          Regards, mav -- Black holes are the places where god divided by 0...

          1 Reply Last reply
          0
          • X xkx32

            Thanks but what index you're talking about? I'm using the LIKE clause to do a simple search...

            E Offline
            E Offline
            Ed Poore
            wrote on last edited by
            #5

            The index is referring to (for example) if you were searching through a list or an array then you'll have to iterate through the items and you can use the position of the array / list (i.e. the index) you're currently at to display in the progress bar. You were not clear in your original question as to what you were searching so I gave you two possible methods.  If you're executing an SQL Query then you'll have to use an infinite progress bar.


            As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it

            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