if you have a console application, you can do it very easily. You can assign the console output to the context.log
context.log = console.out;
my application is using asp.net mvc3 and linq to sql. I want to see the raw sql statement after it gets translated, so I can improve the performance. how do i monitor the output?
You can do something like this:
Then just make sure you use that datacontext to get your tables. As soon as that datacontext is used to access the database the SQL will be output to the logfile.