在下面的查詢LINQ到SQL加入和包含運營商
var restrictions = from p in dcTrad.quop_restricted_items
where p.entry_status == 'P' && p.batch == "PRODUCTION" && p.problem != null
from q in dcTrad.model_companies
where q.co_name != null && p.brimsec == q.primary_bsec
select new { Company = q.co_name, Restriction = p.comment ?? "Restricted without comments", Portfolio = p.problem };
我需要更換
p.brimsec == q.primary_bsec
與
p.brimsec.StartsWith (q.primary_bsec )
,但我得到了以下錯誤:
Only arguments that can be evaluated on the client are supported for the String.StartsWith method
我該如何做這項工作?
沒有linq-to-sql沒有一個導航屬性來跟隨你的外鍵?只是好奇 – 2010-11-20 05:16:21
不...這兩個表都在不同的服務器上 – bmanu 2010-11-20 06:16:56