Hi Frans.
Sql Server 2000. DataAdapter.
Parent entity: Account, child entities: Account.Contacts
Using a wizard control, a new entity, Account is created and populated on the form. On the next wizard page, an UltraGrid is used to populate Account.Contacts. On the following wizard page, the Account.Contacts collection entered on the previous page is used to populate a DropDownList control to select a ContactKey for the Account.ManagerContact field. In other words, I'm using a child entity (Contact) to relate back to the parent (Account). I'm manually setting the Contact PK so that there is a key value that gets applied as a FK to Account.ManagerContact before any persistance.
But... oops! It doesn't work because, as I'm beginning to see, during an INSERT operation, the parent is persisted first and SQL Server throws an exception because it can't relate a Contact row to Account.ManagerContact.
Is it required that I save Account and Contact BEFORE I relate Contact back to Account? Is this a necessary limitation?
Thanks!
Jeff