internal void EnableConstraints()
{
IntPtr hscp;
Bid.ScopeEnter(out hscp, "<ds.DataSet.EnableConstraints|INFO> %d#\n", ObjectID);
try {
bool errors = false;
for (ConstraintEnumerator constraints = new ConstraintEnumerator(this); constraints.GetNext(); ) {
Constraint constraint = (Constraint)constraints.GetConstraint();
errors |= constraint.IsConstraintViolated();
}
foreach (DataTable table in Tables) {
foreach (DataColumn column in table.Columns) {
if (!column.AllowDBNull) {
errors |= column.IsNotAllowDBNullViolated();
}
if (column.MaxLength >= 0) {
errors |= column.IsMaxLengthViolated();
}
}
}
if (errors)
this.FailedEnableConstraints();
}
finally {
Bid.ScopeLeave(ref hscp);
}
}