Just want to see what the best approach would be for the flowing scenario:
I Have a table ListSelections and a table ListSelectionColumns in SQL Server 2008. Of course the last table has a Foreign key to the first table. In this scenario there is always 1 ListSelection record that can have 1 or more ListSelectionColumn records.
Both tables have a primary key with an autonumber.
When implementing this in a model, i want to create a new ListSelectionEntity with 3 new ListSelectionColumnEntities:
lse.Name = TextBox1.Text
i = 1
lsce.Name = TextBox1.Text &
" - Col "
This code generates all the records, 1 ListSelection and 3 ListSelectionColumns records, but the link between them is wrong. The value of the child records, the foreign key, is NULL in stead of the new assigned autonumber from the listSelection.
I discovered this because I used code from august 2010, that errored out; I know it did work in august. Now, instead, I save the ListSelectionEntity
first, and than assign the new id to the child objects.
I provided a sample project (web app) using Q1 2011, latest build:
So, what would be the right approach for this? I was expecting that OA did update the foreign key.
Ok, thanks in advance,