Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Sending the LINQ To SQL log to the debugger output window

When coding apps that use LINQ to SQL, it is very important to check the SQL code generated to make sure that your queries are optimals.  To do this in a Console app, you simply use this code to output the query to the Console window:

ctx.Log = Console.Out;

That's nice but what if your code is in a class library project?  Wouldn't it be nice to output the query to the Output window?  Kris Vandermotten has created a small utility class to do just that.  Check it out here:
http://www.u2u.info/Blogs/Kris/Lists/Posts/Post.aspx?ID=11

Nice work!

 

 

No Comments