LINQ 多條件join on


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();

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM