Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
3.18/5 (10 votes)
See more: , +
<input type="hidden" id="gwProxy"></input><input type="hidden" id="jsProxy" önclick="jsCall();" />
Posted
Comments
shilpi.verma 24-Jun-10 2:50am    
Reason for my vote of 1
bakar jawab

This might not be the best way to do it but you could have a seperate function that runs the same query and just returns a row count and then you pass that row count as you progressBar maxvalue.After that step you parse the sqlreader to your class and iterate through the rows while incrementing your progressbar value.

 

How large is the query that you are running ? WHy not just fill a table using a dataAdapter that will go one shot and should be fast enough that you don't even need a progressBar ?

 

As stated above...I know this is not the best solution but it should work fine.

 

Kind Regards.

 
Share this answer
 
Comments
Dalek Dave 19-Aug-10 5:10am    
Seems Reasonable,
Given the max number of rows is unknown, isn't it better to show something more generic, like a watch or hourglass? Other alternate is, though I don't know how you will fit in your architecture is to show the current record count. That will make user aware of progress (speed) and no false hope of reaching 100% soon.
 
Share this answer
 
Comments
xcorporation 28-Nov-10 23:41pm    
can execute 2 statements - the first is a count() - the second actual query.
can write in the DAL to support automation.
Amund Gjersøe 30-Mar-11 8:00am    
Like setting progressBar1.Style = ProgressBarStyle.Marquee;
Hi
You have two options:

1. As FJD.DEETLEFS said, you should execute a command and get the total records from the data table, and use it as the Maximum value

2. Along with your Data values returned, pass the total records count too along with the data (this is little costlier in terms of network load, since each record will have unnecessary 3-4 bytes load. However, if you can not execute other command before getting data from database, this is best)

You can also use the Page size x Page count to in the code behind, since you are binding to the Grid view.

regards
 
Share this answer
 

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