Click here to Skip to main content
15,794,850 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
hi 2 everybody
i want change this linq query to sql
(from d in Context.OrderDetails
                        join p in Context.Products on d.ProductID equals p.ProductID
                        where d.OrderID==orderid
                        select new
                                Psum = (from da in Context.OrderDetails where da.DetailID == d.DetailID select da.ProductCount * da.ProductPrice).FirstOrDefault()

Have you looked at LinqPad LinqPad[^]?

This is a free utility for using Linq and it will convert the Linq to Sql.

I use it instead of Sql Manager in most cases.
Share this answer
You can see the query in visual studio debugger itself, just put a break point in that query and run it. when it hits the break point, just check it. you can see the query generated in the background.Basically while we run a linq query, the matching sql query is generated at the background that we are not aware of.

Please refer this Link[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900