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

  • Home
  • SEARCH
  • 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 6224275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:38:36+00:00 2026-05-24T08:38:36+00:00

I’m having a problem using WCF Data Services for an entity that has a

  • 0

I’m having a problem using WCF Data Services for an entity that has a composite primary key. I’m using the Silverlight 4 Business Application Template and have created an Entity Data Model (EDM) against the database for the relevant tables and created a WCF Data Service for this EDM in the web project. The Silverlight project has a Service Reference to the WCF Data Service. All fairly standard stuff so far 🙂

For the sake of simplicity and ease of debugging, I’ve narrowed this down to a very simple scenario as follows:

  • Lookup table has columns Id and Data.
  • Lookup2 table has columns Id and Data.
  • MyData table has columns LookupId, Lookup2Id, SomeDate, and ExtraData.
    • LookupId is a foreign key to table Lookup.
    • Lookup2Id is a foreign key to table Lookup2.
    • Columns LookupId, Lookup2Id, and SomeDate form the primary key for table MyData.

I can then load the data from the lookup tables into separate CollectionViewServices by using separate DataServiceCollections. I also load the main data into another CollectionViewSource via a third DataServiceCollection. For the ItemsSource property in the ComboBox controls, I bind to the relevant CollectionViewSource, and then bind the SelectedItem property to the relevant navigation property. This all works fine so far.

I then add a Save Changes button with a Click handler that calls BeginSaveChanges. If I change the value of the ExtraData field, and then click Save Changes the changes are saved without any problems. However, if I change the value of one of the navigation properties I get an exception when BeginSaveChanges is called:

Error processing request stream. Error encountered in setting value for property ‘Lookup’. Please verify that the value is correct.

If I simplify the EDM further so that the foreign key is not part of the composite key, then changes can be saved successfully, however, the composite key in the actual application is an important part of the data model.

Any suggestions on what I’m doing wrong and how to change a navigation property that forms part of a composite key?

Thanks,
Derek.

  • 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-24T08:38:37+00:00Added an answer on May 24, 2026 at 8:38 am

    Changing the key property of an entity is not possible in OData. The main reason is that it would change the identity of the entity, but the entire system assumes that identity never changes. From the point of view of OData changing identity is the same as deleting an existing property and adding a new (different) one.
    It would also mean that the URL of the entity changes, which would not play nice with clients.
    Without the model I don’t know why it fails the way it does for you, but WCF Data Services won’t allow you to change the key property directly anyway.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.