将查询从本机SQL转换为LINQ请求

时间:2010-03-19 09:29:08

标签: c# linq-to-sql

请帮帮我。我如何将此SQL查询转换为LINQ请求?

SELECT TOP (1) PERCENT DATEDIFF(DAY, dbo.PO.ORDER_DATE, GETDATE()) AS Age
                FROM dbo.ITEMS INNER JOIN
                                      dbo.X_PO ON dbo.ITEMS.ITEMNO = dbo.X_PO.ITEM_CODE INNER JOIN
                                      dbo.PO ON dbo.X_PO.ORDER_NO = dbo.PO.DOC_NO AND dbo.X_PO.STATUS = dbo.PO.STATUS
                WHERE     (dbo.ITEMS.ITEMNO = 'MBIN001') AND (dbo.X_PO.STATUS = 3)
                ORDER BY Age

1 个答案:

答案 0 :(得分:1)

如果有人在这里为你创造这个,谁会创建你的第二个?

我建议从这个例子开始,一点一点地找到方法。

http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx