/// <summary>
/// 两个datatable的比较
/// </summary>
/// <param name="objA"></param>
/// <param name="objB"></param>
/// <returns></returns>
private bool ValueEquals(DataTable objA,DataTable objB)
{
if(objA != null && objB != null)
{
if(objA.Rows.Count != objB.Rows.Count)
{
return false;
}
if(objA.Columns.Count != objB.Columns.Count)
{
return false;
}
}
DataView dv = new DataView(objB);
string keys = "";
foreach(DataColumn col in objA.Columns)
{
keys += ","+col.ColumnName;
}
dv.Sort = keys.Substring(1);
foreach(DataRow row in objA.Rows)
{
if(row.RowState != DataRowState.Deleted)
{
if(dv.Find(row.ItemArray)<0)
{
return false;
}
}
else
{
return false;
}
}
return true;
}