Exemplo n.º 1
0
        void MergeTable(DmTable src, DmTable dst)
        {
            if (src.Rows.Count == 0)
            {
                return;
            }

            DmKey key = default(DmKey);

            try
            {
                foreach (DmRow sourceRow in src.Rows)
                {
                    DmRow targetRow = null;
                    if (dst.Rows.Count > 0 && dst.PrimaryKey != null)
                    {
                        key = GetSrcKey(src, dst);
                        var keyValue = sourceRow.GetKeyValues(key);

                        targetRow = dst.FindByKey(keyValue);
                    }
                    dst.MergeRow(sourceRow, targetRow, preserveChanges);
                }
            }
            finally
            {
            }
        }