private void BaseAdd(DataTable table) { if (table == null) { throw ExceptionBuilder.ArgumentNull("table"); } if (table.DataSet == this.dataSet) { throw ExceptionBuilder.TableAlreadyInTheDataSet(); } if (table.DataSet != null) { throw ExceptionBuilder.TableAlreadyInOtherDataSet(); } if (table.TableName.Length == 0) { table.TableName = this.AssignName(); } else { if ((base.NamesEqual(table.TableName, this.dataSet.DataSetName, false, this.dataSet.Locale) != 0) && !table.fNestedInDataset) { throw ExceptionBuilder.DatasetConflictingName(this.dataSet.DataSetName); } this.RegisterName(table.TableName, table.Namespace); } table.SetDataSet(this.dataSet); }
/// <summary> /// Does verification on the table and it's name, and points the table at the dataSet that owns this collection. /// An ArgumentNullException is thrown if this table is null. An ArgumentException is thrown if this table /// already belongs to this collection, belongs to another collection. /// A DuplicateNameException is thrown if this collection already has a table with the same /// name (case insensitive). /// </summary> private void BaseAdd(DataTable table) { if (table == null) { throw ExceptionBuilder.ArgumentNull(nameof(table)); } if (table.DataSet == _dataSet) { throw ExceptionBuilder.TableAlreadyInTheDataSet(); } if (table.DataSet != null) { throw ExceptionBuilder.TableAlreadyInOtherDataSet(); } if (table.TableName.Length == 0) { table.TableName = AssignName(); } else { if (NamesEqual(table.TableName, _dataSet.DataSetName, false, _dataSet.Locale) != 0 && !table._fNestedInDataset) { throw ExceptionBuilder.DatasetConflictingName(_dataSet.DataSetName); } RegisterName(table.TableName, table.Namespace); } table.SetDataSet(_dataSet); //must run thru the document incorporating the addition of this data table //must make sure there is no other schema component which have the same // identity as this table (for example, there must not be a table with the // same identity as a column in this schema. }
/// <summary> /// Does verification on the table and it's name, and clears the table's dataSet pointer. /// An ArgumentNullException is thrown if this table is null. An ArgumentException is thrown /// if this table doesn't belong to this collection or if this table is part of a relationship. /// </summary> private void BaseRemove(DataTable table) { if (CanRemove(table, true)) { UnregisterName(table.TableName); table.SetDataSet(null); } _list.Remove(table); _dataSet.OnRemovedTable(table); }
/// <include file='doc\DataTableCollection.uex' path='docs/doc[@for="DataTableCollection.BaseRemove"]/*' /> /// <devdoc> /// Does verification on the table and it's name, and clears the table's dataSet pointer. /// An ArgumentNullException is thrown if this table is null. An ArgumentException is thrown /// if this table doesn't belong to this collection or if this table is part of a relationship. /// </devdoc> private void BaseRemove(DataTable table) { if (CanRemove(table, true)) { UnregisterName(table.TableName); table.SetDataSet(null); // TODO (EricVas): must run though the document incorporating the removal of this table } }
private void BaseRemove(DataTable table) { if (this.CanRemove(table, true)) { this.UnregisterName(table.TableName); table.SetDataSet(null); } this._list.Remove(table); this.dataSet.OnRemovedTable(table); }
/// <devdoc> /// Does verification on the table and it's name, and clears the table's dataSet pointer. /// An ArgumentNullException is thrown if this table is null. An ArgumentException is thrown /// if this table doesn't belong to this collection or if this table is part of a relationship. /// </devdoc> private void BaseRemove(DataTable table) { if (CanRemove(table, true)) { UnregisterName(table.TableName); table.SetDataSet(null); //Remove dataSet from constriants foreach (Constraint constr in table.Constraints) { constr.SetDataSet(null); } } _list.Remove(table); dataSet.OnRemovedTable(table); }
/// <devdoc> /// Does verification on the table and it's name, and clears the table's dataSet pointer. /// An ArgumentNullException is thrown if this table is null. An ArgumentException is thrown /// if this table doesn't belong to this collection or if this table is part of a relationship. /// </devdoc> private void BaseRemove(DataTable table) { if (CanRemove(table, true)) { UnregisterName(table.TableName); table.SetDataSet(null); } _list.Remove(table); dataSet.OnRemovedTable(table); }
/// <devdoc> /// Does verification on the table and it's name, and points the table at the dataSet that owns this collection. /// An ArgumentNullException is thrown if this table is null. An ArgumentException is thrown if this table /// already belongs to this collection, belongs to another collection. /// A DuplicateNameException is thrown if this collection already has a table with the same /// name (case insensitive). /// </devdoc> private void BaseAdd(DataTable table) { if (table == null) throw ExceptionBuilder.ArgumentNull("table"); if (table.DataSet == dataSet) throw ExceptionBuilder.TableAlreadyInTheDataSet(); if (table.DataSet != null) throw ExceptionBuilder.TableAlreadyInOtherDataSet(); if (table.TableName.Length == 0) table.TableName = AssignName(); else { if (NamesEqual(table.TableName, dataSet.DataSetName, false, dataSet.Locale) != 0 && !table.fNestedInDataset) throw ExceptionBuilder.DatasetConflictingName(dataSet.DataSetName); RegisterName(table.TableName, table.Namespace); } table.SetDataSet(dataSet); //must run thru the document incorporating the addition of this data table //must make sure there is no other schema component which have the same // identity as this table (for example, there must not be a table with the // same identity as a column in this schema. }