Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
Hi all,
I have two forms as Frm1 and Frm2. In Frm1 I will show Frm2. Data is loaded into Frm2. So I want show a waiting screen or progress bar while data in Frm2 is loaded completely. The waiting screen will close after data was loaded completely.
Pls help me done!
Posted

1 solution

Hi,
What you need to effectively display and update a progress bar while doing some task is be able to tell at any given time:

1) how much have you processed until now
2) how much is it to be processed


So in the case of database rows, first start by getting a count of all the rows you have to get to the text file, then loop through each of them and update the value of the progress bar in each loop iteration by using the formula:

[number of rows processed until now] / [number of rows to be processed] * 100

I hope this helps
 
Share this answer
 
Comments
Sandeep Mewara 30-Jun-12 6:07am    
Comment from OP;

Thanks Javed,
If I'm using the formula as you recommend it have some limit and sometime cannot excute. Example: I do it over network => it must send data back client two times and time consuming to count the records; One more, if i run a store procedure or a function in SQL Server so I cannot use this formula.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900