This question is locked. New answers and comments are not allowed.
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.