CodePaste Logo
New Snippet New Recent Snippets Recent Snippets My Snippets My Snippets My Favorites Favorites Web Code Search Snippets Search
Sign inor Register
Language: csharp

Query Odata, Azure Data Source from WIndows Phone

void DoQuery() { // Register for the LoadCompleted event. var _Data = new DataServiceCollection<CityCrime>(); _Data.LoadCompleted += _Data_LoadCompleted; // start the servery query var _Query = GetContext().CityCrime .Where(x => x.State == "Colorado") .Where(x => x.City == "Denver"); _Data.LoadAsync(_Query); } void _Data_LoadCompleted(object sender, LoadCompletedEventArgs e) { var _Data = sender as DataServiceCollection<CityCrime>; if (_Data.Continuation != null) { // sometimes the payload is split into pages // this ensures we get every page of data _Data.LoadNextPartialSetAsync(); return; } // expose the results somehow this.Data = _Data; } // here's a place to store the data // you might want to do something else with it public IEnumerable<CityCrime> Data { get; set; }
by Jerry Nixon
  November 07, 2011 @ 3:56pm
Add a comment

Report Abuse
brought to you by:
West Wind Techologies