views:

151

answers:

1

I want to show my application user a progressbar for following actions:

  1. when they provide login information in WPF and hit submit/OK whatever.
  2. when they request any information from DB (select command execution).

Thank You

+2  A: 

A login to the database is an atomic operation. So you can't really show a progress bar. You can show a waiting indicator (hour glass), or an indeterminate progress bar (which is really just a waiting indicator that looks like a progress bar).

For a query that gets data, you can show progress by paging the result set. There are multiple ways to do this depending on the database/ORM you use. The general principle is to set up a worker thread and grab data one page at a time. After you grab a page, switch context to the UI thread and update the screen to show how much data you grabbed.

Matt Brunell