Error when creating a new entity foo, editing a previously existing foo, then saving. Generic 4004 error
The steps are as simple as that so I imagine there's something else going on here, the problem is I just get back 4004, no exception anywhere etc, making it annoying to debug, I get this from the ie error window
Microsoft JScript runtime error: Unhandled Error in Silverlight Application Code: 4004
Category: ManagedRun开发者_StackOverflow中文版timeError Message: System.Windows.Ria.DomainOperationException: Submit operation failed. An error occurred while updating the entries. See the inner exception for details. at System.Windows.Ria.OperationBase.Complete(Exception error) at System.Windows.Ria.SubmitOperation.Complete(Exception error) at System.Windows.Ria.DomainContext.CompleteSubmitChanges(IAsyncResult asyncResult) at System.Windows.Ria.DomainContext.<>c__DisplayClassd.b__5(Object ) public void TurnPage(bool forward)
{
TurnPageForward = forward;
// If the pages are already turning then don't try and skip days, just run the animation function so it inreases the speed
if (!workBook.IsTransitioning && !IsWaitingForData)
{
IsWaitingForData = true;
workBook.SnapshotPages();
NoteCtx.SubmitChanges().Completed += (s, a) =>
{
workBook.ClearPageContents();
CurrentDate = CurrentDate.AddDays(forward ? 1 : -1);
PullNotes(CurrentDate);
};
}
else
{
workBook.BeginTurnPages(TurnPageForward);
}
}
public void PullNotes(DateTime? noteTime)
{
NoteCtx.NoteItems.Clear();
var loadOp = NoteCtx.Load(NoteCtx.GetNoteItemsForDayQuery(CurrentDate));
loadOp.Completed += new EventHandler(NotesReady);
}
See the inner exception for details.
That's the key. Run your server under the debugger, set it to break on thrown exceptions (Debug -> Exceptions), and look at the InnerException
when it stops.
Got it fixed, turns out that even if 2 databases are identical in schema, if you're switching which one you're referencing you HAVE to regenerate your EDMX file.
精彩评论