Give user feedback during long running query

Posted on 2010-09-06
Last Modified: 2012-05-10

Using vs 2008 and SQL Server 2000 in a windows forms application, I'd like to provide the user with some feedback when they request a large recordset.  I am using a search form where they can enter multiple criteria and the SQL Statement is created on the fly.  If they want a years worth of data for example, it might return hundreds of thousands of records.  This takes several minutes with the only option to stop the search clicking the close form button and killing the program.  

One option I saw was creating a moving marquee but that doesn't give the user an estimate of the time to fill the dataset.

Ideally I'd like a way to tell the user what is happening besides that annoying wait cursor.  A record count as the records are sent over would be awesome (I thought about creating a govenor to limit the records to 5000 or whatever the user chooses but they need to have a fully open search capability).  Is there any way to ask the server what the status is of the query?  I suspect I'm getting into multithreading hell here but I've found users get frustrated if they don't see something return in 5 seconds or less...

Thanks for any ideas
Question by:zipnotic
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
LVL 13

Expert Comment

ID: 33614476

good morning!

you can use progress bar here...

take a look on this link...

i hope i can give you some idea...


Accepted Solution

PagodNaUtak earned 250 total points
ID: 33614789
I suggest you to use paging... Do not load the entire records just 100 of the results.
The user will have an option to select next batch of records.
Here is an example queries using SQL Server 2005 
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.


Expert Comment

ID: 33614793

Expert Comment

ID: 33614924
I go for paging too

Expert Comment

ID: 33614933
if that is not an option, Telerik has a good grid with a Load-On-Demand feature. it loads records when scrolling to see more records.

Author Closing Comment

ID: 33618878
Paging will work for me thank you.

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question