Detached Row And Relations in DataSet

J

Joe

Hi,

Does anybody know how to set the parent row of a child table's row to a
detached row?
I'm using Forms DataBinding. If I add a new row for editing, using
BindingContext(someDataSet,"ParentTable").AddNew()
the row's RowState is Detached. Now, if I try to add any child rows to a
child table with this row set as the child rows' parent, an
InvalidConstraintException will be thrown, telling me that the child's key
value must exist in in the parent table (which it doesn't because the parent
row is still detached). Is there a way around this, without having to first
add the parent row to its table (by calling bindingcontext(someDataSet,
"ParentTable).EndCurrentEdit())?

Hope that all made sense

Thanks,

Dave Hagedorn
 
M

Miha Markic

Hi Joe,

You could disable the relation for the time being and re-enable it at the
end of operation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top