Is it possible to show a ProgressBar to show the Progress of a Webservice Call?
I’m using a webservice which calls a SQL Database and returns, on demand, a List of the requested data.
Webservice Code
public List<LocationUpdate> GetAllLocationsByUserID(int UserID)
{
MainframeConnectionDataContext db = new MainframeConnectionDataContext();
var validLocations = from query in db.LocationUpdates select query;
return validLocations.ToList();
}
Client Code
void Window1_Loaded(object sender, RoutedEventArgs e)
{
dg_sql_data.ItemsSource = CMainFrameConnection.GetAllLocationsByUserID(0);
}
Currently it takes about 5-10 Seconds before the Data is loaded.
Any Ideas?
- rAyt
A progress bar might not be appropriate here as you presumably can’t tell how far through the operation is. It might be more appropriate to display a ‘loading’ animation of some kind.
e.g. some example animations you could use here http://www.ajaxload.info/
EDIT: As Dreas points out, setting IsIndeterminate is a good way to handle this.