替换DataTable列名
/// <summary>
/// 替换表头
/// </summary>
/// <param name="dt"></param>
/// <param name="list">键值对("测试","test")</param>
/// <returns></returns>
public static DataTable isReplace(this DataTable dt, Dictionary<string, string> list)
{
if (dt != null)
{
if (list != null)
{
//循环datatable
for (int i = 0; i < dt.Columns.Count; i++)
{
//获取datatable的标头
var s = dt.Columns[i].ColumnName;
foreach (var item1 in list)
{
//判断标头与key是否相等
if (s.Equals(item1.Key.ToString().Trim()))
{