D
Danny Liberty
Hi,
I have a simple windows forms application which resembles a
parent-child table relationship. To be more specific, the form is bound
to a table called "Sales" and it also contains a datagrid which is
bound to a "SalesDetail" table. When I add a new record to the form and
then try to add a new record the sales detail grid, I get a constraint
error since the parent row dosen't "exist" yet (the dataset hasn't been
updated). One way I've found of solving this is disabling constraints
on the dataset, but this seems like a workaround. I could also update
the dataset with the parent row before the user adds the childs row via
the datagrid, but this also seems wrong since I shouldn't be updating
the dataset until the user actually hits update.
Any suggestions ? Is there a "classical" solution to this type of
problem ?
Thanks in advance !
Danny
I have a simple windows forms application which resembles a
parent-child table relationship. To be more specific, the form is bound
to a table called "Sales" and it also contains a datagrid which is
bound to a "SalesDetail" table. When I add a new record to the form and
then try to add a new record the sales detail grid, I get a constraint
error since the parent row dosen't "exist" yet (the dataset hasn't been
updated). One way I've found of solving this is disabling constraints
on the dataset, but this seems like a workaround. I could also update
the dataset with the parent row before the user adds the childs row via
the datagrid, but this also seems wrong since I shouldn't be updating
the dataset until the user actually hits update.
Any suggestions ? Is there a "classical" solution to this type of
problem ?
Thanks in advance !
Danny