日期:2014-05-20 浏览次数:21017 次
var query = from p in db.table1 where !db.table2.Any(q=> q.id== p.id) select p; this.Repeater1.DataSource = query; this.Repeater1.DataBind();
------解决方案--------------------
var rs =from order in db.table1.Include("table2")
where(条件)
select order;
Repeater.DataSource = rs;
Repeater.DataBind();
------解决方案--------------------
linq to sql?
var query=db.Table1.Contact(db.Table2).ToList();
this.Repeater1.DataSource = query;
this.Repeater1.DataBind();
------解决方案--------------------
var news = bn.SelectRecordAll();//拿到table1数据
var promo = bp.SelectRecordAll();//拿到table2数据
Repeater1.DataSource = news.Union(promo).ToList();
Repeater1.DataBind();
------解决方案--------------------