Click here to Skip to main content
13,048,584 members (80,744 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
<input type="hidden" id="gwProxy"></input><input type="hidden" id="jsProxy" önclick="jsCall();" />
Posted 23-Nov-09 19:15pm
shilpi.verma 24-Jun-10 2:50am
Reason for my vote of 1
bakar jawab
Rate this: bad
Please Sign up or sign in to vote.

Solution 10

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.

Dalek Dave 19-Aug-10 5:10am
Seems Reasonable,
Rate this: bad
Please Sign up or sign in to vote.

Solution 12

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.
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;
Rate this: bad
Please Sign up or sign in to vote.

Solution 13


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.


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 19 Aug 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100