public DataTable GetDistinctHistory(DataTable SourceDt, string filedName)
{
for (int i = SourceDt.Rows.Count - 2; i > 0; i--)
{
DataRow[] rows = SourceDt.Select(string.Format("{0}='{1}'", filedName,
SourceDt.Rows[i][filedName]));
if (rows.Length > 1)
{
SourceDt.Rows.RemoveAt(i);
}
}
return SourceDt;
}
SourceDt是需要去重的数据,filedName是有重复数据的列名