By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,658 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,658 IT Pros & Developers. It's quick & easy.

Need threading help with progress bar Form

P: 5
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
Share this Question
Share on Google+
2 Replies


kenobewan
Expert 2.5K+
P: 4,871
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

P: 5
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.