/// <summary>
/// 复制DataTable
/// </summary>
/// <param name="copyDt">数据源</param>
/// <param name="tableName">新DataTable名称</param>
/// <returns>复制后的DataTable</returns>
private DataTable CopyDataTable(DataTable copyDt, string tableName)
{
DataTable dt = new DataTable(tableName);
foreach (DataColumn columm in copyDt.Columns)
{
dt.Columns.Add(columm.ColumnName,columm.DataType);
}
foreach (DataRow row in copyDt.Rows)
{
dt.BeginInit();
dt.ImportRow(row);
dt.EndInit();
}
return dt;
}