我有以下代碼。我想檢查結果是否爲帶有if條件的null
,但總是顯示錯誤。如何解決這個問題?如何解決LINQ中的錯誤:數據爲空或空
string StrRefNo = Request.QueryString["ref"];
string[] SMSid = StrRefNo.Split('$');
DownloadsDbEntities db = new DownloadsDbEntities();
var data = (from d in db.SMSLink_Expiry
where d.RefNo == SMSid[0]
&& d.SMSLink.ID == Convert.ToInt32(SMSid[1])
select d).ToList();
if (data.Count > 0)
{
string ss = "yes";
}
的LINQ表達式節點類型 'ArrayIndex' 在LINQ不支持對實體。