Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling Identities
Message
 
À
12/03/2010 14:43:26
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01454212
Message ID:
01454367
Vues:
43
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform