System.Data.DataTable.ResetIndexes C# (CSharp) Method

ResetIndexes() private method

private ResetIndexes ( ) : void
return void
        internal void ResetIndexes() => ResetInternalIndexes(null);

Usage Example

Example #1
0
        /// <summary>
        /// Clears the collection of all rows.
        /// </summary>
        public void Clear()
        {
            if (this.table.DataSet != null && this.table.DataSet.EnforceConstraints)
            {
                foreach (Constraint c in table.Constraints)
                {
                    UniqueConstraint uc = c as UniqueConstraint;
                    if (uc == null)
                    {
                        continue;
                    }
                    if (uc.ChildConstraint == null || uc.ChildConstraint.Table.Rows.Count == 0)
                    {
                        continue;
                    }

                    string err = String.Format("Cannot clear table Parent because " +
                                               "ForeignKeyConstraint {0} enforces Child.", uc.ConstraintName);
                    throw new InvalidConstraintException(err);
                }
            }

            table.DataTableClearing();
            List.Clear();

            // Remove from indexes
            table.ResetIndexes();
            table.DataTableCleared();
            OnListChanged(this, new ListChangedEventArgs(ListChangedType.Reset, -1, -1));
        }
All Usage Examples Of System.Data.DataTable::ResetIndexes
DataTable