Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using AutoInc fields
Message
From
24/06/2010 13:20:04
 
 
To
24/06/2010 13:07:58
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01470401
Message ID:
01470434
Views:
25
>>Hi,
>>
>>using MM.NET 3.6 and SQL Server 2008.
>>
>>If I have an AutoInc field (Identity in SQL Server) and use the Business Layer Generator, I then get a warning when I build my project:
>>
>>Field 'SamaanSystems.IAS.Business.AgentEntity._agentNumber' is never assigned to, and will always have its default value 0
>>
>>Now, I have not set this field as a Primary Key as it is actually being used as a Candidate Key. Also the value never gets generated as far as I can tell.
>>
>>What do I need to do to get this to work?
>
>That does not sound like something is right. I would compare the way that property in the entity is constructed with another entity object that also has a integer identity column. The _agentNumber field should be set from the "set" part of the property.
>Tim

All the identity fields got generated the same way. Note that although they are identity fields I do not use these fields as the primary key (I prefer Guids for the PK).

But see my response to Bob, it works when I do not display the field on my form.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform