Does SQL server give feedback about the progress so it is will be possible to reflect or bind it with the progress bar?
Does SQL server give feedback about the progress so it is will be possible to reflect or bind it with the progress bar?
Maybe but not sure of it.
Another trick is to retrieve first all primary keys (ID) of the resulting query.
Then retrieve/update again the data basing on the ID set one by one thus can be bound to a progress bar.
This is what MsAccess does for ODBC tables when updating, retrieving and showing data on screen.
This way also one can paginate thus making display faster.
you want to have a progress bar (WinForm) while retrieving/updating large datas?
if you mean return the current progress while the query is executing on sql server
- i think there is no way, if you notice in sqlserver management studio while you are doing some huge select statements the management studio doesnt really returns the current progress of sql server but rather just a 'preloader' type of progress bar with no current progress on it.
but if you mean display progress after the query has been executed and is now ready to return the
results.
heres what i usually do
I get the total count of resulting query
then do some
so basically the code will update the progress bar every 1 second (or what ever you like) while you are still reading the record.Code:while (reader.read()) { record++ if(CurrentTickCountFunction() > tickcount + 1000) { tickcount = CurrentTickCountFunction() UpdateProgressBar(record) } ... do some stuff } UpdateProgressBar(record)
i prefer doing the tickcount technique rather than some modulo solutionbecause it will always be constant on every computer regardless of its processing power.
if you wont be able to get the total count, then you should consider a different progress bar where it displays the total record reads-to-Unknown
usually i create the UpdateProgressBar() function as a delegate/ event so the form
using your class can subscribe to that event
below is a tool i created to upload images to Imageshack servers, which displays the current progress but its in c#
RapidShare Webhosting + Webspace
similar concept: Big Data + progress bar
Last edited by silent-kill; 12-27-2008 at 08:00 AM.
nice one silent kill...
yeah! bling bling men...abz'
@javapenguin
bro, database has nothing to do with the progress status. all you need is to play it on the codes.
Similar Threads |
|