views:

431

answers:

3

I'm wondering if there is a tried/true method for reporting the progress of a DB call from a .Net application to its user. I'm wondering if it's even possible to actually indicate a percentage of completion, or is the best/only approach to simply display a "loading" animation to indicate that something is happening?

Also, does SQL2008 address this to anyone's knowledge?

+1  A: 

You have to load things deterministically. For example if you know that you'll be fetching a lot of data, for example, you might do something like:

-get a count of all of the records -get 500 of them -report status as 500/total % -get 500 more -report status as 1000/total % -... continue until you've gotten them all of the user has canceled

This would be incredibly wasteful on something that takes no time at all, since the mere fact of going to the database is a large part of the overhead.

Ben Scheirman
+1  A: 

As far as I know there is no way to do this. My suggestion is use one of the circular progress bars that just spins forever. Microsoft uses these in database operations in SQL and Project.

Here is an article on CodeProject that has a variety of these:

http://www.codeproject.com/KB/vb/sql2005circularprogress.aspx?fid=324397&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2205952

Adam Berent

Adam Berent
A: 

how did you solved this? i'm searching for the same thing, no relevant results so far

If there's not enough information here to help you solve your problem, you should post the details of what you're trying to do in a new question. Link back to this question and let everyone know that your problem is similar, but be specific about how it is different.
Bill the Lizard
No.. I just have a spin animation. I'm keeping this on my wish-list however.
madcolor