如:
var TasComID = (from ee in LinkToSQL.TasCom
where ee.TasComNum == cbb_TasComNum.SelectedItem.ToString() && ee.IsDeleted == false
select ee.TasComID).Distinct();
if(TasComID.FirstOrDefault()!=null)
ID = TasComID.Single();
判断linq语句结果是否为空的方法,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/swtool/p/3840128.html