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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:57:42+00:00 2026-05-13T14:57:42+00:00

Here is the inner exception: InnerException: System.Data.UpdateException Message=Entities in ‘OrganizerDBEntities.Assignments’ participate in the ‘CourseId’

  • 0

Here is the inner exception:

InnerException: System.Data.UpdateException
Message=Entities in 'OrganizerDBEntities.Assignments' participate in 
the 'CourseId' relationship. 0 related 'Course' were found. 
1 'Course' is expected.`  

I have three tables (Folder, Assignment, Course). The Assignment table has a primary key called AssignmentId and a foreign key called CourseId whose ‘Allow Nulls’ property has been set to true. So this exception is preventing me calling _entities.SaveChanges(); and thus peventing me from adding data to the database.


UPDATE: Thanks to marc, That problem was solved, but another arose:

 InnerException: System.Data.UpdateException
        Message=An error occurred while updating the entries. See the InnerException for details.
        Source=System.Data.Entity
        StackTrace:
             at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
             at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)
             at System.Data.Objects.ObjectContext.SaveChanges(Boolean acceptChangesDuringSave)
             at System.Data.Objects.ObjectContext.SaveChanges()
             at AssignmentOrganizer.App_Data.AssignmentRepository.CreateAssignment(Assignment assignmentToCreate) in C:\Users\Mohit\Documents\Visual Studio 2010\Projects\AssignmentOrganizer\AssignmentOrganizer\App_Data\AssignmentRepository.cs:line 19
             at AssignmentOrganizer.MainWindow..ctor() in C:\Users\Mohit\Documents\Visual Studio 2010\Projects\AssignmentOrganizer\AssignmentOrganizer\MainWindow.xaml.cs:line 54
        InnerException: System.Data.EntityCommandCompilationException
             Message=An error occurred while preparing the command definition. See the inner exception for details.
             Source=System.Data.Entity
             StackTrace:
                  at System.Data.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)
                  at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.CreateCommand(UpdateTranslator translator, Dictionary`2 identifierValues)
                  at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
                  at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
             InnerException: System.NotSupportedException
                  Message=Server-generated keys and server-generated values are not supported by SQL Server Compact.
                  Source=System.Data.SqlServerCe.Entity
                  StackTrace:
                       at System.Data.SqlServerCe.SqlGen.DmlSqlGenerator.GenerateReturningSql(StringBuilder commandText, DbModificationCommandTree tree, ExpressionTranslator translator, DbExpression returning)
                       at System.Data.SqlServerCe.SqlGen.DmlSqlGenerator.GenerateInsertSql(DbInsertCommandTree tree, List`1& parameters, Boolean isLocalProvider)
                       at System.Data.SqlServerCe.SqlGen.SqlGenerator.GenerateSql(DbCommandTree tree, List`1& parameters, CommandType& commandType, Boolean isLocalProvider)
                       at System.Data.SqlServerCe.SqlCeProviderServices.CreateCommand(DbProviderManifest providerManifest, DbCommandTree commandTree)
                       at System.Data.SqlServerCe.SqlCeProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
                       at System.Data.Common.DbProviderServices.CreateCommandDefinition(DbCommandTree commandTree)
                       at System.Data.Common.DbProviderServices.CreateCommand(DbCommandTree commandTree)
                       at System.Data.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)
                  InnerException: 
  • 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-13T14:57:43+00:00Added an answer on May 13, 2026 at 2:57 pm

    First thing I would check is the association OrganizerDBEntities.Assignments in your EF conceptual model. Does it allow for 0:n relations? From the error message, I am lead to believe it doesn’t. You can tweak the cardinality (the min and max possible values) in your EF model.

    If you select an association between two entities in your EDMX designer surface, the properties window shows both ends of the association. In each of those “End” properties, there’s a “Multiplicity” values which defines the cardinality of the association: 0:*, 0..1:*, 1:* and so forth.

    If you do want to allow a missing value, the multiplicity on the child end of your association needs to be 0..1 (Zero or One) – is it really 0..1 (Zero or One) ? Or is it set to 1 instead?

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

Sidebar

Related Questions

I'm getting an exception with this code; InnerException: System.InvalidOperationException Message=The specified type was not
and here is the inner exception at the end : Could not load file
Here is my query select * from table1 inner join table2 on table1.typeId=table2.typeId; This
I'm sure inner require isn't the correct term, but it'll make sense here shortly.
Here is the code which reads data from a serial port. To keep the
im getting exception while i am fatching the data from the text-box of gridview
Here is my HTML: <li> <div class=menu_inner> <a href=#> <div class=button><img class=486 src=images/portalbutton.png /></div>
I infer from Google search results that strings.h (from here ) is for UNIX
here is jsfiddle sample - http://jsfiddle.net/6bKHc/120/ and code - var move, inter; inter =
innner OnItemDataBound event (itemtype) should be hit twice, as here I have 2 children.

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.