G
Guest
Hi,
This should be a fairly simple question. With our next project, we've
decided to make use of the sql server relationships to force concurrency (no
orphaned records). We formerly were doing this on the dataset, but sometimes,
it wasn't necessary to get child data, and we could get orphaned records.
Anyways, we're having trouble on some situations where you delete a record
from the parent table. It automatically deletes the record from the child
table, causing an error when we try to update the child table. But if I set
all of the delete rules to none, it causes an exception, because it orphans
the row. As soon as the update would occur, there'd be no orphaned records.
I suppose I could do:
dataset.GetChanges(System.Data.DataRowState.Deleted).AcceptChanges()
but I wanted to make sure there was no better solution that would make more
sense.
Thanks in advance.
This should be a fairly simple question. With our next project, we've
decided to make use of the sql server relationships to force concurrency (no
orphaned records). We formerly were doing this on the dataset, but sometimes,
it wasn't necessary to get child data, and we could get orphaned records.
Anyways, we're having trouble on some situations where you delete a record
from the parent table. It automatically deletes the record from the child
table, causing an error when we try to update the child table. But if I set
all of the delete rules to none, it causes an exception, because it orphans
the row. As soon as the update would occur, there'd be no orphaned records.
I suppose I could do:
dataset.GetChanges(System.Data.DataRowState.Deleted).AcceptChanges()
but I wanted to make sure there was no better solution that would make more
sense.
Thanks in advance.