你好。我想加盟4个表:LINQ内部连接4个表(将SQL转换为C#LINQ)
tStore(STOREID,STORE_NAME)
tSection(SectionID,SECTION_NAME)
tSectionSqft(SectionSqftID,STOREID,SectionID,平方英尺)
tSectionForwardSelling(SectionForwardSellingID ,店号,节号,金额,日期)
我想查询给我结果:
STORE_NAME,SECTION_NAME,平米,金额
我需要这个SQL查询转换为C#LINQ:
SELECT
tStore.Store_Name,
tSection.Section_Name,
tSectionSqft.Sqft,
tSectionForwardSelling.Amount
FROM tSection
INNER JOIN tSectionForwardSelling
ON tSection.SectionID = tSectionForwardSelling.SectionID
INNER JOIN tSectionSqft
ON tSection.SectionID = tSectionSqft.SectionID
INNER JOIN tStore
ON tSectionForwardSelling.StoreID = tStore.StoreID
AND tSectionSqft.StoreID = tStore.StoreID
我想对我自己的,但每次LINQ给了我错误的结果。
您是否使用实体框架? –
你已经试过了什么,你看到了什么错误的结果? – Hammerstein
是的。它是Asp.net MVC项目。 – Timur