I'm having a problem with using the table adapters to accomplish this and was wondering if someone might know of something I could be doing wrong.
The scenario is this:
Adding a new record to the underlying SQL database in this case requires that both a record exist in TableA and TableB. TableA holds the "One" and TableB holds the "Many" in this case.
The form I have is a Wizard style form that prompts the user for multiple pieces of data required to make these records.
All of the data is saved for TableA, but completely dropped from existance with no error displayed for TableB.
I can't figure this out...I keep thinking it has something to do with the PK. At the time of save, the PK for TableA hasn't been set, so it can't create the relationship to TableB because the PK doesn't exist yet. At least that's my theory.
The solution (though not very attractive to me) is to break the wizard into two steps, prompt for TableA data and then TableB data and saving the data between steps to the database. I don't like this solution though because it just complicates things if the user decides to cancel the wizard in the second step and not complete it, or the network drops and the user closes the form without completing the wizard. With everything on one page and not sent to the database until the step is completed (the "wizard" is only 1 step) orphan records can't really exist unless the moon and stars are lined up just right and the forces of evil band together to break the network in that single microsecond. Course, with my luck lately that's a high probability.
Any ideas or suggestions?