468,316 Members | 2,134 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

Error during tableAdapter.update does not trigger an exception

My situation compares to this: I have two tables parentTable(id, foreignId)
and childTable(id, value). "foreignId" in the "parentTable" references "id"
in "childTable". The constraint is by default set to "ON DELETE NO ACTION"
(using sql server 2005), which means the delete fails if there are related
records in the childTable.

My main problem is that when I use the datatable.Remove() method and later
execute the tableadapter.update() method, the record isn't deleted on the
database server, however it is removed from the datatable.rows
rowcollection. There are no exception thrown when the delete command fails
for the record flagged for deletion in the tableadapter.

My question is: How can I handle this concurrency problem? In an elegant
way. I imagine the sane end result is to report about the failed delete, and
keep the record flagged for deletion in the datatable, or return the record
to the original datatable.

Thank you.

- Magnus
Sep 8 '06 #1
1 2097
Never mind the question, its sorted.
Sep 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by M | last post: by
2 posts views Thread by Rhino | last post: by
2 posts views Thread by Richard | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.