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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:38:53+00:00 2026-05-25T20:38:53+00:00

For some time I couldn’t find out the cause of an error when trying

  • 0

For some time I couldn’t find out the cause of an error when trying to update a field in a table using WCF Data Services plus Entity Framework:

MydbEntities context = new MydbEntities(new Uri("http://localhost:53051/Services/MydbService.svc"));
MyEntity entitytoedit = context.MyEntity.FirstOrDefault();
entitytoedit.Name = "TheNewName";
context.UpdateObject(entitytoedit);
context.BeginSaveChanges(OnChangesSaved, context);
...

The error was like following: RequestException An error occurred while processing this request.

The fix was to add an autoincremental decimal(18, 0) field as the Primary Key with Identity Specification IsIdentity = yes instead of just a varchar(20) field as the Primary Key.

Please, could anybody explain the nature of the problem: should I always use autoincremental Primary Keys with WCF Data Services? If not, where in fact am I wrong?

  • 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-25T20:38:54+00:00Added an answer on May 25, 2026 at 8:38 pm

    I think it is more Entity Framework question than WCF Data Services.

    You can either have primary key field that you set by hands and you must set StoreGeneratedPattern to None.

    Or you can use AutoIncrement field as primary key and in this case you must set StoreGeneratedPattern for it to Identity.

    Mixing this to cases always break the things. In addition when you do Model First, primary key field by default has type int and StoreGeneratedPattern set to Identity, so just changing the type to decimal as in your case is not enough.

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

Sidebar

Related Questions

I've been trying to figure this out for quite some time now. I couldn't
I've seen this somewhere in SO some time ago, but I couldn't find it
I've been looking around for some time and couldn't find a clear explanation for
I spent some time looking around, and all I could find is Jython. It's
Some time ago I got this error when building ANY Visual Studio Deployment project.
since quite some time I'm trying to listen to .pls files (shoutcasts). I have
We have been using Teamcity for some time for the Continous Integration in the
I started using jQuery Mobile some time ago, and as those that know jQuery
I have been using Hadoop quite a while now. After some time I realized
I've been writing output from perl scripts to files for some time using code

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.