Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling Identities
Message
 
To
12/03/2010 14:43:26
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01454212
Message ID:
01454367
Views:
42
Frank,

>I have changed a varchar column to a smallint identity column, regenerated using the Business Layer Generator, but when I run my application I get this error:
>
>Column 'AgentNumber' is read only.

It looks as if you are trying to save a value to an identity column, which is illegal because it's readonly.

The BLG doesn't make the property read-only because it is matching what the Entity Framework does for entities--it creates both a get() and set() for identity columns. This is because both the Entity Framework entities and MM .NET entities can work with databases other than SQL Server, and some of those databases do allow you to change the identity column value.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform