G
Guest
Hi,
I discovered a bug in ConstraintsCollection:
Suppose you have two constraints, with the same columns but different names;
one already in the collection, one you try to add it to collection.
if you want to add the Constraint to the collection and check whether it
already exists, you use DataTable.Constraints.Contains(constraintName) which
returns false;
You then try to add the constraint.
Here you'll get an exception, because, inside .Add() there is a check using
an internal method, FindConstraint(Constraint) which looks in the
constraint's columns and returns true...
so beautiful there is the .NET... )
Dan.
I discovered a bug in ConstraintsCollection:
Suppose you have two constraints, with the same columns but different names;
one already in the collection, one you try to add it to collection.
if you want to add the Constraint to the collection and check whether it
already exists, you use DataTable.Constraints.Contains(constraintName) which
returns false;
You then try to add the constraint.
Here you'll get an exception, because, inside .Add() there is a check using
an internal method, FindConstraint(Constraint) which looks in the
constraint's columns and returns true...
so beautiful there is the .NET... )
Dan.