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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:39:25+00:00 2026-05-23T19:39:25+00:00

I have a simple console app using SQL Compact 4.0 and entity frameworks 4.

  • 0

I have a simple console app using SQL Compact 4.0 and entity frameworks 4. The database has a single table called Section which has three columns: Id (StoreGeneratedPattern: Identity, Type: Int32), Title (Type: string) and TimeStamp (StoreGeneratedPattern: Computed, ConcurrencyMode: Fixed, Type: Binary, MaxLength: 8). The TimeStamp column is actually a rowversion type in SQL Compact.

I have the following code in main:

Section section = new Section();
section.Title = "Hello";

using (Entities1 context = new Entities1())
{
    context.Sections.AddObject(section);                
    context.SaveChanges();

    section.Title = "Changed";
    context.SaveChanges();
}

This code throws a concurrency exception because the TimeStamp column is not getting updated from the database after the first SaveChanges() method. Note that it works fine in SQLServer2008.

Is this a bug in Compact or am I missing something?

Thanks,

Darren

  • 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-23T19:39:25+00:00Added an answer on May 23, 2026 at 7:39 pm

    I found the problem. Turns out it is a bug in the edmx designer where the property for StoreGeneratedPattern is not being written to the underlying xml file. It is saved only in the CSDL part but not in the SSDL part See http://www.ladislavmrnka.com/2011/03/the-bug-in-storegeneratedpattern-fixed-in-vs-2010-sp1/ Note that in that blog he says it is fixed in VS2010 SP1, well I have that version and it is not fixed in mine!

    Entering it by hand into the xml file fixed the problem. Unfortunately subsequent changes clear it again.

    Darren

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

Sidebar

Related Questions

I have a very simple console app where I'm using dataset.WriteXml(@c:\temp) but I'm getting
What am I doing wrong? I have a simple console app in VS08. When
I'm writing a simple console client-server app using MSMQ. I'm attempting to run it
I have a simple console app that calls a WCF service over net.tcp and
I have a URI here in which a simple document.cookie query through the console
Ok, i have simple scenario: have two pages: login and welcome pages. im using
I'm having a strange behavior in Linq to Sql... I have a simple parent
I created a super simple console app to test out the Enterprise Library Caching
I am working on a simple console app to get my feet wet with
In this sample console app I want to update a row in a table,

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.