日期:2014-05-17 浏览次数:20514 次
public static DataTable GetTableMerge(DataTable dt)
{
if (dt == null
------解决方案--------------------
dt.Rows.Count == 0)
{
return dt;
}
else
{
ArrayList Al = new ArrayList();
for (int i = 0; i < dt.Rows.Count; i++)
{
String s = dt.Rows[i][0].ToString();
if (!Al.Contains(s))
{
Al.Add(s);
}
}
DataTable result = new DataTable();
result = dt.Clone();
//初始化新表
for (int i = 0; i < Al.Count; i++)
{
DataRow drtmp = result.NewRow();
drtm