public static void AppendToTable(dataTableType DTType, string controllerName, DataTable table) { DataTable copyTable = table.Copy(); DataTable sourceTable = dataDict[controllerName].Tables[DTType.ToString()]; sourceTable.Merge(copyTable); }
public static void AddTable(dataTableType DTType, string controllerName, DataTable table) { DataTable copyTable = table.Copy(); if (dataDict[controllerName].Tables.Contains(DTType.ToString())) { DataTable sourceTable = dataDict[controllerName].Tables[DTType.ToString()]; sourceTable.Clear(); sourceTable.Merge(copyTable); sourceTable.AcceptChanges(); } else { dataDict[controllerName].Tables.Add(new DataTable(DTType.ToString())); dataDict[controllerName].Tables[DTType.ToString()].Merge(copyTable); } }