I'm trying to update an entity using the method detailed under option 2 in "Modifying an entity" in the 2.6 documentation.
Dim o As New StoreItemTypesEntity()
o.StoreItemTypeId = storeItemTypeId
o.IsNew = False
o.StoreItemType = "x"
o.TypeDescription = "x"
o.Save()
StoreItemTypeId is table's primary key.
Using the code above I'm getting the following error:
The field 'StoreItemTypeId' is read-only and can't be changed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: SD.LLBLGen.Pro.ORMSupportClasses.ORMFieldIsReadonlyException: The field 'StoreItemTypeId' is read-only and can't be changed.
Source Error:
Line 774: End Get
Line 775: Set
Line 776: SetValue(CInt(StoreItemTypesFieldIndex.StoreItemTypeId), value, True)
Line 777: End Set
Line 778:
Source File: C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\NSA\InStoreChamp.DLL\EntityClasses\StoreItemTypesEntity.vb Line: 776