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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:33:53+00:00 2026-05-14T15:33:53+00:00

I have a database that consists of 5 tables : Course, Category, Location, CourseCategories,

  • 0

I have a database that consists of 5 tables : Course, Category, Location, CourseCategories, and CourseLocations. The last 2 tables just contain the two foreign keys. A Course has many-to-many relationships with both category and location.

I am trying to load the data into a Silverlight app using Ria Services. My DB model is Linq-to-SQL. I have tried adding the [Include] attribute to the metadata classes and I have added the DataLoadOptions so it should load the all tables when you ask for a Course. However on the client side I am never getting back any entries in the CourseCategories and CourseLocations properties.

What else needs to be done to get the foreign key relationships to exist across the serialization.

  • 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-14T15:33:54+00:00Added an answer on May 14, 2026 at 3:33 pm

    There are two steps for including records from a foreign key relationship:

    1. Tell WCF RIA Services about the Include

    By placing the [Include] attribute in the definition of your Entity, above the foreign key

    [Include]
    public MyOtherTable MyOtherTable { get; set; }
    

    2. Tell WCF RIA Servics that this particular query uses that Include

    In your query, you must use the .Include("MyOtherTable") logic to tell this query to include the data from that relationship.

    public IQueryable<Table> GetTable()    
    {
        return this.ObjectContext.Table.Include("MyOtherTable");
    }
    

    It sounds like you are missing the second step. This second step allows you to choose which queries download those extra records.

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

Sidebar

Related Questions

I have a database that consists of two tables, which look like this: users
I have a database that which contains two tables, links and tour. Tour is
Consider a database(MSSQL 2005) that consists of 100+ tables which have primary keys defined
I have an access 2007 Database that consists of 3 tables each having 1
If you have a set of tables in the database that strictly consist of
I have a MS access database. In that, one table consists of questions and
Let's say I have a large database that consists of products in groups. Let's
I have a database that has around 10k records and some of them contain
I have a database that has 16 tables, but only four are relevant to
I have a database with a table that consists of 65k+ entries, which is

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.