(from s in dc.StockInItem   //所要查询单表

join si in dc.StockIn           //联合的表

on s.StockInID equals si.StockInID     //两个表联合的相同条件 

where (s.ColorsID == int.Parse(colorID) && s.SizesID == int.Parse(sizeID) && s.ProductID == int.Parse(ProtectID) && si.Status == "Audited") 

//条件

select s.Quantity).Sum()   //查出所有 Quantity 的总和

posted on 2014-06-18 10:38  小菜鸟——  阅读(2759)  评论(0编辑  收藏  举报