internal static void Merge(DataSet targetSet, DataSet sourceSet, bool preserveChanges, MissingSchemaAction missingSchemaAction)
        {
            if (targetSet == null)
            {
                throw new ArgumentNullException("targetSet");
            }
            if (sourceSet == null)
            {
                throw new ArgumentNullException("sourceSet");
            }
            if (sourceSet == targetSet)
            {
                return;
            }

            bool prevEC = targetSet.EnforceConstraints;

            targetSet.EnforceConstraints = false;

            foreach (DataTable t in sourceSet.Tables)
            {
                MergeManager.Merge(targetSet, t, preserveChanges, missingSchemaAction);
            }

            AdjustSchemaRelations(targetSet, sourceSet, missingSchemaAction);
            targetSet.EnforceConstraints = prevEC;
        }
Пример #2
0
        public void Merge(DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }
            if (!IsLegalSchemaAction(missingSchemaAction))
            {
                throw new ArgumentOutOfRangeException("missingSchemaAction");
            }

            MergeManager.Merge(this, table, preserveChanges, missingSchemaAction);
        }
Пример #3
0
        public void Merge(DataSet dataSet, bool preserveChanges, MissingSchemaAction missingSchemaAction)
        {
            if (dataSet == null)
            {
                throw new ArgumentNullException("dataSet");
            }
            if (!IsLegalSchemaAction(missingSchemaAction))
            {
                throw new ArgumentOutOfRangeException("missingSchemaAction");
            }

            MergeManager.Merge(this, dataSet, preserveChanges, missingSchemaAction);
        }
Пример #4
0
        public void Merge(DataRow[] rows, bool preserveChanges, MissingSchemaAction missingSchemaAction)
        {
            if (rows == null)
            {
                throw new ArgumentNullException("rows");
            }
            if (!IsLegalSchemaAction(missingSchemaAction))
            {
                throw new ArgumentOutOfRangeException("missingSchemaAction");
            }

            MergeManager.Merge(this, rows, preserveChanges, missingSchemaAction);
        }