我有以下 linq to sql 查询,我绑定到详细信息视图
var ShippingChallan = (from sc in db.ShippingChallanViewSeconds
where sc.challan_id == Convert.ToDecimal(txtChallanNo.Text) && sc.SecondWeight != null && sc.Type == "LBO"
select new {
sc.challan_id,
sc.bowzer_no,
sc.FirstWeight,
sc.SecondWeight,
sc.netWeight,
sc.Product_Name,
sc.FLD,
sc.Customer_Name,
sc.dip1,
sc.Cmpt_Capacity1,
sc.dip2,
sc.Cmpt_Capacity2,
sc.dip3,
sc.Cmpt_Capacity3,
sc.dip4,
sc.Cmpt_Capacity4,
sc.dip5,
sc.Cmpt_Capacity5
}).FirstOrDefault();
在 99% 的行中,sc.dip4 和 sc.dip5 为空。
如果它们为空,我不想向用户显示这些属性。
我该怎么做???任何的想法???