日期:2014-05-17 浏览次数:20936 次
foreach (DataRow dr1 in dt1.Rows) { foreach (DataRow dr2 in dt2.Rows) { if (dr1["id"].ToString() == dr2["id"].ToString()) { dr1.Delete(); dr2.Delete(); break; } } } dt.AcceptChanges();//
DataTable dt1 = new DataTable(); DataTable dt2 = new DataTable(); var dt3 = from r in dt1.AsEnumerable() where !( from rr in dt2.AsEnumerable() select rr.Field<int>("Id") ).Contains( r.Field<int>("Id")) select r;
------解决方案--------------------