Click here to Skip to main content
11,929,944 members (59,323 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as



See the SQL Generated by LINQ

, 18 Jul 2011 CPOL
If you are the type that likes to debug production code, you can use SQL Profiler to find queries generated by your LINQ statements. This is a technique I recently used because it was so simple and did not require me to recompile anything.Note that StefanHam already posted this alternate...


Members may post updates or alternatives to this current article in order to show different approaches or add new features.

8 Apr 2011
Henry Minute
Or, there's always Scott Guthrie's LINQ To SQL Debug Visualizer[^].[Edit]While I'm posting links there is a nice utility that can output the generated SQL to the Debug Window in VS written by Kris Vandermotten.You can get it here[^].To use it: MyDataContext db = new...
17 Jul 2011
Philippe Mori
LINQPad is an interesting tool to try queries.LINQPad[^]Perfect tool to try out some alternatives for complex queries. As we can see generated queries and elapsed time, it help a lot to help having fast queries for complex requests.
26 Feb 2010
3 alternatives  
When using LINQ to SQL, it can be very useful to see the SQL commands that are generated by your LINQ expressions. Sometimes the results are surprising and you might be able to improve performance by tweaking the LINQ.All you have to do is set the Log property of the DataContext object. ...


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


About the Author

Web Developer
United States United States
  • Managing Your JavaScript Library in ASP.NET (if you work with and you don't read that, you are dead to me).
  • Graduated summa cum laude with a BS in Computer Science.
  • Wrote some articles and some tips.
  • DDR ("New high score? What does that mean? Did I break it?"), ping pong, and volleyball enthusiast.
  • Software I have donated to (you should too):

| | Privacy | Terms of Use | Mobile
Web04 | 2.8.151126.1 | Last Updated 18 Jul 2011
Article Copyright 2011 by AspDotNetDev
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid