// No impact on AutoIncrementCurrent if over written
internal int CopyRecord(DataTable src, int record, int copy)
{
if (record == -1)
{
return(copy);
}
Debug.Assert(src != null, "Can not Merge record without a table");
int newRecord = copy;
if (copy == -1)
{
newRecord = table.NewUninitializedRecord();
}
for (int i = 0; i < table.Columns.Count; ++i)
{
DataColumn objColumn = table.Columns[i];
int iSrc = src.Columns.IndexOf(objColumn.ColumnName);
if (iSrc >= 0)
{
SetValue(newRecord, i, src.Columns[iSrc][record, false]);
}
else
{
if (copy == -1)
{
objColumn.Init(newRecord);
}
}
}
return(newRecord);
}