internal override bool IsConstraintViolated()
{
Index childIndex = childKey.GetSortIndex();
object[] uniqueChildKeys = childIndex.GetUniqueKeyValues();
bool errors = false;
Index parentIndex = parentKey.GetSortIndex();
for (int i = 0; i < uniqueChildKeys.Length; i++)
{
object[] childValues = (object[])uniqueChildKeys[i];
if (!IsKeyNull(childValues))
{
if (!parentIndex.IsKeyInIndex(childValues))
{
DataRow[] rows = childIndex.GetRows(childIndex.FindRecords(childValues));
string error = Res.GetString(Res.DataConstraint_ForeignKeyViolation, ConstraintName, ExceptionBuilder.KeysToString(childValues));
for (int j = 0; j < rows.Length; j++)
{
rows[j].RowError = error;
}
errors = true;
}
}
}
return(errors);
}