Skip to content

Keeping in Control of Events

Posted on:September 23, 2004 | at 10:27 AM
READING TIME1 minute

Originally posted on geekswithblogs.net

At work, I’m having an issue with losing control over events in my code. One big issue I’m having is recursion in the DataRow.RowChanged event.

In this case, I’m trying to update the database, during every whenever e.Action == DataRowAction.Changed. This also means having a call to DataRow.AcceptChanges() which raises another DataRowAction.Changed. I also have instances when e.Action == DataRowAction.Changed but DataRow.RowState == DataRowState.Unchanged.

Some thoughts I came up with to try to combat this madness is to…

What kinds of things do all of you do to keep events under control?