locked
Error Messages "An Item with the same key has already been added" and "Value cannot be null" RRS feed

  • Question

  • I am getting two errors when using an expand query from a proxy class generated using VS2008.  The first error “An Item with the same key has already been added” happens when I make an expand query two levels deep where the last level can have repeated items.  The second error “Value cannot be null” happens when there are no child records for a parent record within the expanded dataset.  

    You can see the errors on a live demo on this link:  http://webswapp.com/categories/Silverlight/ADONET/ExpandQuery.aspx

    You can also download the complete source code (VS2008 project file plus a MS SQL express database) from the same link.

    Sunday, May 3, 2009 7:16 AM

Answers

  • Hello,

    This is  a known issue with Expand and MergeOption.OverwriteChanges.
    Try this with MeregOption set to AppendOnly or PreserveChanges and it should work.

    I hope this helps,
    Monica Frintu
    Monday, May 4, 2009 10:39 PM
    Moderator

All replies

  • Hello,

    This is  a known issue with Expand and MergeOption.OverwriteChanges.
    Try this with MeregOption set to AppendOnly or PreserveChanges and it should work.

    I hope this helps,
    Monica Frintu
    Monday, May 4, 2009 10:39 PM
    Moderator
  • Thanks,

    The MergeOption.PreserveChanges worked for one case but not the other whereas the MergeOption.AppendOnly worked for both cases.

    BTW, is there a URL for the list of Known Issues with the current release of ADO.Net Data Services?
    Tuesday, May 5, 2009 12:39 AM