var item1 = (from a in db.Item
where
(a.ItemNo == Item.ItemNo || Item.ItemNo==null ) &&
(a.StatusId == Item.StatusId || Item.StatusId == 0) &&
(a.LocationId == Item.LocationId || Item.LocationId == 0)
select a).ToList();
return View(item1);
我得到了例外
[ Argument # = 1,Name of function(if known) = isnull ]
我也试过这段代码
var item1 = (from a in db.Item
where
(a.ItemNo == Item.ItemNo || Item.ItemNo=="") &&
(a.StatusId == Item.StatusId || Item.StatusId == 0) &&
(a.LocationId == Item.LocationId || Item.LocationId == 0)
select a).ToList();
return View(item1);
但没有工作得到错误
[String truncation: max=0, len=2, value='10'. ]