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 892643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:05:25+00:00 2026-05-15T14:05:25+00:00

I just started learning Silverlight by walking through the labs posted on Channel9. When

  • 0

I just started learning Silverlight by walking through the labs posted on Channel9. When I tried to explore a little bit I found that my queries were not working as I thought they would.

To recreate what I have done you would need to create a new Silverlight Business application, create a data entity that is pointed to the Adventureworks LT db, and generate the web services for those entities (including edit).

I then simply drug a RichTextbox to Home.xaml and in Home.xaml.cs I added this code first to OnNavigatedTo and when that didn’t work to the constructor.

    AdventureWorksDomainContext ctx = new AdventureWorksDomainContext();

    EntityQuery<Product> query =
        from p in ctx.GetProductsQuery()
        select p;
    LoadOperation<Product> loadOp = ctx.Load(query);

    var paragraph = new Paragraph();
    foreach (var product in loadOp.Entities)
    {
        paragraph.Inlines.Add(new Run { Text = product.Name });
    }

    richTextBox1.Blocks.Add(paragraph);

When I run the page I never see loadOp.Entities contain a value and I only see the query I expect, go across the wire after all my code has been executed.

I feel like I’m missing something fundamental and this will make more sense if I can find someone to explain it to me.

Thanks,
Eric

  • 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-05-15T14:05:26+00:00Added an answer on May 15, 2026 at 2:05 pm

    The problem is related to the how you are loading the data. The actual Load operation is asynchronous, as is all Silverlight network calls. You are callingt ctx.Load(query) and then immediately setting the paragraph to the entities. You need to use a callback when Load is completed. Something like this,

        AdventureWorksDomainContext ctx = new AdventureWorksDomainContext();
    
    EntityQuery<Product> query =
        from p in ctx.GetProductsQuery()
        select p;
    LoadOperation<Product> loadOp = ctx.Load(query,() => 
    {
        var paragraph = new Paragraph();
        foreach (var product in loadOp.Entities)
        {
            paragraph.Inlines.Add(new Run { Text = product.Name });
        }
    
        richTextBox1.Blocks.Add(paragraph);
    });
    

    Since you aren’t using the entities directly in a binding and are just iterating them, you need to make sure you wait until they are loaded. I can’t remember the actual signature of the Load method, so you may need to modify my lambda to make it work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i just started learning MFC..found a tutorial here http://bit.ly/j2uhHO ..just tried the same thing
I am just started learning silverlight and it's controls. I am pretty much sure
I just started learning Python... I am writing a simple program that will take
I've just started learning Silverlight and I learned it is a client side program.
I am just learning Blend/Silverlight/VS2010/.net/etc. I have a simple project that resides on a
I just started learning objective c. I have this little problems and questions, hope
I just recently started learning Windows Phone 7 development, C# and Silverlight. I'm making
I just started learning C. What I am trying to right now is that
I just started learning Silverlight and I failed to use a transparent background for
Just started learning shell scripting..just a bit confused between the two. they seem to

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.