This is a migrated thread and some comments may be shown as answers.

Update Function is not working anymore

1 Answer 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rasid
Top achievements
Rank 1
Rasid asked on 07 Mar 2016, 02:04 PM

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.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 10 Mar 2016, 09:02 AM
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.
Tags
General Discussions
Asked by
Rasid
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or