Software to help you build a better store
SEARCH
June 9, 2004

My constraints were violated

Yesterday I wrote about a bug that I finally found. After I found the problem, I googled “Merge(DataRow[]) events” and found Introduction to Dataset Updates. A little light reading later I found,

“Constraints are automatically disabled when the Merge method is invoked on a dataset. When the merge is complete if there are any constraints on the dataset that cannot be enabled a ConstraintException is thrown. In this situation, the EnforceConstraints property is set to false and all constraint violations must be resolved before resetting the EnforceConstraints property to true.”

Furthermore, it pointed out that when EnforceConstraints is False,

“It suspends certain update events from being raised.“

So the merge must have caused a constraint exception, although no exception was thrown (the code was wrapped in a Try...Catch that would have published the exception).

This site looks much better in a browser that supports current web standards, but it is accessible to any browser. Download one now This link is to a third party web site which will open in a new window

Some parts of this site will not work effectively on this older browser.
Please consider updating your browser This link is to a third party web site which will open in a new window

SSL