$sql = "SELECT * FROM installment WHERE SellorderID = (";
$sql .= "SELECT ID FROM sellorder WHERE ShopID = (";
$sql .= "SELECT ID FROM shop WHERE Number = $shopno)) AND Received = 0";
$shopno
是函數的參數。如何在LINQ c中編寫此查詢#
$sql = "SELECT * FROM installment WHERE SellorderID = (";
$sql .= "SELECT ID FROM sellorder WHERE ShopID = (";
$sql .= "SELECT ID FROM shop WHERE Number = $shopno)) AND Received = 0";
$shopno
是函數的參數。如何在LINQ c中編寫此查詢#
這是一個開放式問題。
您的目標解決方案是想要使用LinqToSql,實體框架,本地數據源還是......?
我建議你看看這個指南,以更多地瞭解C#中的LinqToSql。
希望它能幫助。
試試這個:
from i in Installment
join so in SellOrder
on i.SellOrderId equals so.ID
join sh in Shop
on so.ShopId equals sh.Id
where sh.Number == $shopno && i.Received == 0
select i
非常感謝你的兄弟 –
你能收拾格式的問題,請。 –
模型是怎樣的?你能指定實體框架版本嗎?最後一個問題,你試過了什麼? –