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:
01454520
Views:
30
Frank,

Check your Insert stored procedure (or SQL statement depending on what you use) for inserting into your base table and be sure you do not have a value that is passed in for this identity column. If you didn't regenerate the data access layer using the BLG, you would have a problem with this.


Bob

>Hi,
>
>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.
>
>in my AgentEntity class on this code:
>
>
>		public Int16 AgentNumber
>		{
>			get
>			{
>				if (this.Row != null)
>					return (Int16)mmType.GetNonNullableDbValue(this.Row["AgentNumber"], "System.Int16");
>				else
>					return this._agentNumber;
>			}
>			set
>			{
>				if (this.Row != null)
>					this.Row["AgentNumber"] = value; 
>				this._agentNumber = value;
>				this.OnPropertyChanged(new PropertyChangedEventArgs("AgentNumber"));
>			}
>		}
>		private Int16 _agentNumber;
>
>The error occurs on this.Row["AgentNumber"] = value;
>
>What have I done wrong/missed out here?
>.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform