MultiKeyManager TryCreateKeyFromValues on SubmitChanges throws Index was outside the bounds of the array RRS feed

  • Question

  • Hi!

    I've got an association where the relationship is not defined in the database, but is in the dbml. The entities both have multiple columns as primary keys, but only one field participating in the logical relation. I've read a few forum posts describing workarounds by adding single-keys, but that's not a preferred solution.

    The code has worked before (god knows which update made it crash), and of course it works on W7.

    We have tried applying KB95484 and KB959209 on our W2003 servers, but none resolves the error. 3.5 SP1 is installed on the servers.

    Since it has worked before, I'm not very keen on changing the data structure and code for free, but I'm very keen on continuing to host a working application for our customer.

    Any help is appreciated.

    Here's the error:

    [IndexOutOfRangeException: Index was outside the bounds of the array.]
       System.Data.Linq.MultiKeyManager`3.TryCreateKeyFromValues(Object[] values, MultiKey`2& k) +322
       System.Data.Linq.IdentityCache`2.Find(Object[] keyValues) +37
       System.Data.Linq.StandardIdentityManager.Find(MetaType type, Object[] keyValues) +23
       System.Data.Linq.CommonDataServices.GetCachedObject(MetaType type, Object[] keyValues) +48
       System.Data.Linq.ChangeProcessor.GetOtherItem(MetaAssociation assoc, Object instance) +142
       System.Data.Linq.ChangeProcessor.BuildEdgeMaps() +254
       System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) +59
       System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) +331
       System.Data.Linq.DataContext.SubmitChanges() +19


    Lars-Erik MCPD ASP.NET 2.0
    Tuesday, April 26, 2011 12:11 PM


All replies