Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.5 VS2008 C#
<input type="hidden" id="gwProxy"></input><input type="hidden" id="jsProxy" önclick="jsCall();" />
Posted 23-Nov-09 19:15pm
vhassan625
Comments
shilpi.verma at 24-Jun-10 2:50am
   
Reason for my vote of 1
bakar jawab
Rate this: bad
good
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.

  Permalink  
Comments
Dalek Dave at 19-Aug-10 5:10am
   
Seems Reasonable,
Rate this: bad
good
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.
  Permalink  
Comments
xcorporation at 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 at 30-Mar-11 8:00am
   
Like setting progressBar1.Style = ProgressBarStyle.Marquee;
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 13

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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 370
1 Sergey Alexandrovich Kryukov 205
2 Prakriti Goyal 177
3 jlopez788 134
4 _Amy 110
0 OriginalGriff 6,762
1 Sergey Alexandrovich Kryukov 5,539
2 Maciej Los 3,479
3 Peter Leow 3,323
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 19 Aug 2010
Copyright © CodeProject, 1999-2014
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