Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Go to top

See the SQL Generated by LINQ

, 8 Apr 2011
Rate this:
Please Sign up or sign in to vote.
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...
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 MyDataContext();
 
  db.Log = new DebuggerWriter();
 
Also, if you have downloaded the Visual C# 2008 Samples[^] (VB 2008 Version[^]), you will find an ObjectDumper off the LINQ Samples folder, that allows displaying any kind of object on the console output. All the child properties are also displayed and you can even define how deep you want to go through child properties.
 
Since one of it's overloaded Write() methods allows you to specify a TextWriter and the DebuggerWriter, linked to above, is a TextWriter descendant, you can also get ObjectDumper to output to the Debug Window.
 
[/Edit]
 
[Edit II (Edit Harder)]
Further to my previous edit I have now found a WPFified implementation of ObjectDumper here[^].
[/Edit II (Edit Harder)]

License

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

Share

About the Author

Henry Minute
Retired
United Kingdom United Kingdom
Retired Systems Admin, Programmer, Dogsbody.
Mainly on Systems for Local Government, Health Authorities,
Insurance Industry - (COBOL eeeeeeeugh).
Inventor of Synchronized Shopping.

Comments and Discussions

 
GeneralNice link, thanks! PinmemberKarthik. A7-Apr-11 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 8 Apr 2011
Article Copyright 2011 by Henry Minute
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid