Need threading help with progress bar Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikelis
    New Member
    • Jul 2007
    • 5

    #1

    Need threading help with progress bar Form

    I have a main form that does a lengthy database query. Before I fire off the
    query, I need to pop up another form that contains a progress bar and a Close button. The progress bar updates for 30 seconds and then pops up a timeout message with an OK button that closes the form when pressed. Also, the user has an option of closing the form while the bar is being updated. Thus, this form needs to be threaded.

    The main form calls the progress bar form via thread because it has to continue with the Database query while the progress bar is being updated in order to terminate the progress bar form if the query finishes before the 30 second timeout.

    This seemingly minor effort is driving me nuts dues to cross threading issues. I've played around with delegates but can't get it right.

    Has anyone doen this before and could provide some code or suggestions on how to accomplish this?

    Thanks. James
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    My question is does your query really need to take this long, can it be optimised? Multiple short queries are more efficient than one long one.

    Have you thought of using Ajax for this task?

    Comment

    • mikelis
      New Member
      • Jul 2007
      • 5

      #3
      Originally posted by kenobewan
      My question is does your query really need to take this long, can it be optimised? Multiple short queries are more efficient than one long one.

      Have you thought of using Ajax for this task?
      Actually, it does not make a query, it performs another function that takes awhile, i only said query to make things easier to understand.

      Comment

      Working...