日期:2014-05-20 浏览次数:20778 次
var ps = from d in dt.AsEnumerable()
join r in re on d.Field<string>("part_no") equals r.IFSID into joinedEmpDept
from dept in joinedEmpDept.DefaultIfEmpty()
select new
{
IFSID = d.Field<string>("part_no"),/*从这边开始就报错了*/
Description = d.Field<string>("Description"),
Num = d.Field<decimal>("count_variance"),
Unit = d.Field<string>("unit_meas"),
IN_TRANSIT = d.Field<decimal>("IN_TRANSIT"),
Price = d.Field<decimal>("price"),
MAX = dept.MAX,
MIN = dept.MIN
};
//这样写就不报错
//但是这样写貌似不是左连接,
//dt.AsEnumerable()里面原来有十条数据,用下面的方法只能查询出5条
//既是两个表中都有的5条,另外5条没了
var ps = from d in dt.AsEnumerable()