当前位置: 移动技术网 > IT编程>开发语言>.net > LINQ 多条件join on

LINQ 多条件join on

2018年09月23日  | 移动技术网IT编程  | 我要评论

canimalsdiary,百草龙凤宝,山东玩具批发市场

var  tmp = from a in dt1.asenumerable()
join b in dt2.asenumerable()
on new { bm = a.field<string>("编码"), lx = "类型" } equals new { bm = b.field<string>("编码"), lx = b.field<string>("类型") }
into ab
from c in ab.defaultifempty()
select new
{
编码 = a.field<string>("编码"),
类型 = c == null ? "" : c.field<string>("类型")
};
dt_结果 = tmp.mycopytodatatable();

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网