public void Merge(DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction)
{
long logScopeId = DataCommonEventSource.Log.EnterScope("<ds.DataTable.Merge|API> {0}, table={1}, preserveChanges={2}, missingSchemaAction={3}", ObjectID, (table != null) ? table.ObjectID : 0, preserveChanges, missingSchemaAction);
try
{
if (table == null)
{
throw ExceptionBuilder.ArgumentNull(nameof(table));
}
switch (missingSchemaAction)
{
case MissingSchemaAction.Add:
case MissingSchemaAction.Ignore:
case MissingSchemaAction.Error:
case MissingSchemaAction.AddWithKey:
Merger merger = new Merger(this, preserveChanges, missingSchemaAction);
merger.MergeTable(table);
break;
default:
throw ADP.InvalidMissingSchemaAction(missingSchemaAction);
}
}
finally
{
DataCommonEventSource.Log.ExitScope(logScopeId);
}
}