System.Data.DataKey.GetSortIndex C# (CSharp) Method

GetSortIndex() private method

private GetSortIndex ( ) : Index
return Index
        internal Index GetSortIndex() => GetSortIndex(DataViewRowState.CurrentRows);

Same methods

DataKey::GetSortIndex ( DataViewRowState recordStates ) : Index

Usage Example

コード例 #1
0
        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);
        }
All Usage Examples Of System.Data.DataKey::GetSortIndex