View Single Post
  #1 (permalink)  
Old November 5th, 2011, 10:46 AM
jayinatlanta jayinatlanta is offline
Registered User
Points: 17, Level: 1
Points: 17, Level: 1 Points: 17, Level: 1 Points: 17, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Default Ch 14: Try it Out p. 511 - error 'dependent property in a ReferentialConstraint'

Here's another error I can't trace. I checked the forum and couldn't find anything like it.

On this one, VS generates no errors. I'm able to get all the way through entering a new album, AND information on a new "picture." Then I get this nasty stuff:

Error: A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: 'Id'

Code:
[InvalidOperationException: A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: 'Id'.]
   System.Data.Mapping.Update.Internal.UpdateCompiler.BuildSetClauses(DbExpressionBinding target, PropagatorResult row, PropagatorResult originalRow, TableChangeProcessor processor, Boolean insertMode, Dictionary`2& outputIdentifiers, DbExpression& returning, Boolean& rowMustBeTouched) +7529061
   System.Data.Mapping.Update.Internal.UpdateCompiler.BuildInsertCommand(PropagatorResult newRow, TableChangeProcessor processor) +122
   System.Data.Mapping.Update.Internal.TableChangeProcessor.CompileCommands(ChangeNode changeNode, UpdateCompiler compiler) +432

[UpdateException: An error occurred while updating the entries. See the inner exception for details.]
   System.Data.Mapping.Update.Internal.TableChangeProcessor.CompileCommands(ChangeNode changeNode, UpdateCompiler compiler) +616
   System.Data.Mapping.Update.Internal.<ProduceDynamicCommands>d__0.MoveNext() +725
   System.Linq.<ConcatIterator>d__71`1.MoveNext() +359
   System.Data.Mapping.Update.Internal.UpdateCommandOrderer..ctor(IEnumerable`1 commands, UpdateTranslator translator) +233
   System.Data.Mapping.Update.Internal.UpdateTranslator.ProduceCommands() +161
   System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter) +222
   System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache) +163
   System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options) +657
   System.Web.UI.WebControls.EntityDataSourceView.ExecuteInsert(IDictionary values) +559
   System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +81
   System.Web.UI.WebControls.ListView.HandleInsert(ListViewItem item, Boolean causesValidation) +382
   System.Web.UI.WebControls.ListView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +657
   System.Web.UI.WebControls.ListView.OnBubbleEvent(Object source, EventArgs e) +227
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.ListViewItem.OnBubbleEvent(Object source, EventArgs e) +112
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +159
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +39
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3765
I went back and checked all the steps of this try-it-out, including regenerating the listview, making sure I had deleted the right portions of code, making sure the Where statement was correct, etc.

Where should I look?

Thanks,

Jay
Reply With Quote