G
Guest
I am using .NET 2.0 and writing code using C#.
I have a datatable that is being filled with data and it has a primary key,
which is a single column ID. There are cases where there can be duplicate
records inserted into this table. I am trying to capture these errors by
setting EnforceConstraints = false and populating the table.
When I set EnforceConstraints = true after populating the table I catch the
ConstraintException and call GetErrors on the table to retrieve the rows in
error.
However, when there is more than one duplicate row in the table it only
seems to provide me with the first set of rows that caused it to fail not all
of them like I would expect and have seen in other cases like Null contraint
violations.'
Does anybody know if this is supposed to be the behavior or am I missing
something?
I have a datatable that is being filled with data and it has a primary key,
which is a single column ID. There are cases where there can be duplicate
records inserted into this table. I am trying to capture these errors by
setting EnforceConstraints = false and populating the table.
When I set EnforceConstraints = true after populating the table I catch the
ConstraintException and call GetErrors on the table to retrieve the rows in
error.
However, when there is more than one duplicate row in the table it only
seems to provide me with the first set of rows that caused it to fail not all
of them like I would expect and have seen in other cases like Null contraint
violations.'
Does anybody know if this is supposed to be the behavior or am I missing
something?