【发布时间】:2011-09-05 03:44:05
【问题描述】:
我有以下 LINQ2SQL 查询:
From pc In DBContext.ProcessCodes
Join c In DBContext.Cells On pc.idCell Equals c.idCell
Where pc.idType = "Cars" AndAlso
pc.Active = True AndAlso
c.Active = True
Select c
由于某种原因,当我认为我应该获得内部联接时,我得到了交叉联接(笛卡尔积)。如果我在 where 中使用键比较执行多个 From,我会得到同样的结果。
我做错了什么?
【问题讨论】:
-
您的第一步可能是检查生成的 SQL。 davidhayden.com/blog/dave/archive/2007/08/17/…
标签: vb.net visual-studio-2010 linq-to-sql