T
Tony Martini
Hello all
I have a VB.Net Windows Forms application that is using bound controls. I
have datarelations defined for the parent and child tables with the Update,
Delete and accept/reject rules all set to default ( which is cascade). I can
modify and delete records. I can add records to the parent table as long as
I am not also adding child records. When I add a parent record and add a
record to the grid bound to the child table I get an error stating that the
row id must exist in the parent table. I do not want to remove the
constraints so how do I allow users to add a parent record and a child
record in one session.. I call parentdataadapter.update first then
childdataadapter.update. I thought this would add the parent records then
the child records. If I set dataset.enforceconstraints = false before
calling dataset.addnew it does not give me an error when I exit the grid but
it does not insert the child records.
I have a VB.Net Windows Forms application that is using bound controls. I
have datarelations defined for the parent and child tables with the Update,
Delete and accept/reject rules all set to default ( which is cascade). I can
modify and delete records. I can add records to the parent table as long as
I am not also adding child records. When I add a parent record and add a
record to the grid bound to the child table I get an error stating that the
row id must exist in the parent table. I do not want to remove the
constraints so how do I allow users to add a parent record and a child
record in one session.. I call parentdataadapter.update first then
childdataadapter.update. I thought this would add the parent records then
the child records. If I set dataset.enforceconstraints = false before
calling dataset.addnew it does not give me an error when I exit the grid but
it does not insert the child records.