This is the full code i used to test the case
Imports SD.LLBLGen.Pro.ORMSupportClasses
Imports MyDAL.EntityClasses
Partial Class _Default
Inherits System.Web.UI.Page
Dim organisation As OrganisationEntity
Dim _entity As EntityBase
Public Property Entity() As EntityBase
Get
Return _entity
End Get
Set(ByVal value As EntityBase)
_entity = value
End Set
End Property
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Me.Entity = OrganisationEntity.GetByKey(2)
TextBox1.Text = Me.Entity.Fields("Name").DbValue
'organisation = OrganisationEntity.GetByKey(2)
'TextBox1.Text = organisation.Name
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ok As Boolean
Me.Entity.Fields("Name").CurrentValue = TextBox1.Text
Me.Entity.Save()
'this code works
'organisation.Name = TextBox1.Text
'organisation.Save()
End Sub
End Class