Problem with Parent Child Data Binding
Brady Kelly <[email protected]> Sun, 17 Feb 2008 12:37:11 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
I have a parent child relationship, on DocumentID, between an invoice and invoice lines. A form displays invoice fields and has a grid for invoice lines. The grids BindingSource points to the Invoice Binding Source, and it's DataMember to the relation, so I think this is correct. Now, if I leave the relation type to Only Relation, the DocumentID in my new Invoice is -1, and the DocumentID in my Invoice Lines grid is also -1, but the Line record remains -1 after being written to the database. So, I think maybe I should make the relation a constrain as well and add a cascade update, but then I get an error that -1 doesn't exist in the parent table, even though the Invoice datatable DocumentID is -1.