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.
}