Update Function is not working anymore

2 posts, 0 answers
  1. Rasid
    Rasid avatar
    5 posts
    Member since:
    Oct 2011

    Posted 07 Mar Link to this post

    I'm using RIA Services, Silverlight 5.0, and Telerik for Silverlight v2014.3.1402.1050..
    I got this error when I want to update an item using Ria Services 

    The property 'Id' is part of the object's key information and cannot be modified.

    private void SetPolygonRange()
    {
        var context = new ObjectContext();
        var rangeName = PolygonRangeNameComboBox.Text;
        var query = context.GetPolygonRangesByNameQuery(rangeName);
        context.Load(query, UpdatePolygonRange, context);
    }
     
    private void UpdatePolygonRange(LoadOperation<PolygonRange> lo)
    {
        var range = lo.Entities.First();
        range.Name = "New Name";
        var context = (ObjectContext) lo.UserState;
        context.SubmitChanges();
        Close();
    }

    PolygonRange is only ID and Name. I dont update the primary key here, but the error tell me that I can't update the primary key.
    Previously, it works well (in windows 8 and SQL Server 2010).

    Then I update to windows 10 and SQL Server 2012, and all of updates function is not working anymore. I'm not sure that the OS update have anything to do with the error.

    I'm not sure which one that cause this error.
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 10 Mar Link to this post

    Hi Rasid,

    This seems as a general Silverlight question and is not related to any of our Silverlight controls, that's why I'd suggest you post it either on MSDN forums or StackOverflow.

    If you have any concrete questions or issues regarding the controls from UI for Silverlight suite, we will be glad to help.

    Regards,
    Yana
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft banner
Back to Top