你好。我想加盟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