I need some advice.
I am trying to save a parent (doctor) and child (address) object in one hit in such a way that the parent key is auto placed into the child object. I did the following
In the address object i added the foreignkey assignment as follows
Public Sub New()
Me.TableName = "address"
Me.PrimaryKey = ""
Me.DefaultCommandType = CommandType.Text
Me.ForeignParentKeyField = "parent_PK"
then i added a property to doctor called address and registered it as a child object. Then I did the following code in my app test
'' Now we have an address pk we can create DR
Dim loDoctor As Doctor = New Doctor
loDoctor.NewRow()
loDoctor.Entity.First_name = "Erin"
loDoctor.Entity.Last_Name = "Noonan"
loDoctor.Entity.notify_emails = "
sales@infotoday.com.au"
'' Create new address first
loDoctor.Address.NewRow()
loDoctor.Address.Entity.post_code = "2060"
loDoctor.Address.Entity.state = "NSW"
loDoctor.Address.Entity.street = "Walker St"
loDoctor.Address.Entity.street_no = "161"
loDoctor.Address.Entity.suburb = "North Sydney"
loDoctor.SaveRow()
this created bith parent and child objects but did not assign the parent key. Am i missing something?