Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9198567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:18:56+00:00 2026-06-17T22:18:56+00:00

My app makes a simple call the an Azure Webservice database and I want

  • 0

My app makes a simple call the an Azure Webservice database and I want to copy the returned rows into a new list.

private IMobileServiceTable<dbEntry> entryTable = App.MobileService.GetTable<dbEntry>();
private MobileServiceCollectionView<dbEntry> currentEntries;

currentEntries = (entryTable.Where(ev => ev.event_date.Month == dateToShow.Month)
            .ToCollectionView());

foreach (dbEntry ev in currentEntries)
{
    //insert ev into another List
}

The problem is that the “where” call to the DB is asynchronous, so by the time the loop is reached there are no elements in currentEntries yet.

How can I detect that the call has completed before executing the loop? Is there an event handler for this?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:18:57+00:00Added an answer on June 17, 2026 at 10:18 pm

    It sounds like you found this solution already but I’ll post it for anyone else that comes across this.

    Unless you directly want to bind a UI element to the results of the operation, I suggest you do not use the ToCollectionView method. Instead, do the following:

    private IMobileServiceTable<dbEntry> entryTable = App.MobileService.GetTable<dbEntry>();
    private List<dbEntry> currentEntries;
    
    currentEntries = await entryTable.Where(ev => ev.event_date.Month == dateToShow.Month)
       .ToListAsync();
    
    foreach (dbEntry ev in currentEntries)
    {
        //insert ev into another List
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want make simple call app. I use this code. Intent intent = new
I want to make a simple app that shows a list of contacts (name,
I'm making a simple app that makes some calculations. Some of these calculations are
I've made a simple C# WinForms app, which makes a screen-capture using System; using
I want to make a simple app, where a UIWebView with custom content will
I am fairly new to iOS development and trying make a simple app which
I am a newbie to iPhone app development. I want to make a simple
I'm trying make my first python app. I want make simple email sender form.
I'm making a mobile app where the app will call a simple URL drivin
I have grails app that makes a REST call. If an error occurs, a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.