471,874 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,874 software developers and data experts.

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
Mar 28 '08 #1
2 1045
kenobewan
4,871 Expert 4TB
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?
Mar 29 '08 #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?
Actually, it does not make a query, it performs another function that takes awhile, i only said query to make things easier to understand.
Mar 31 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by pmcguire | last post: by
3 posts views Thread by Keith Mills | last post: by
6 posts views Thread by hzgt9b | last post: by
7 posts views Thread by Mike P | last post: by
10 posts views Thread by Mike P | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.