Skip to main content

Show LINQ to SQL Queries in debug console output.

//
// Send/debug LINQ to SQL Query via Console output
//

// configure the datacontext to print the query which is used for the
// actual resultset to console out
//
// use System.Data.Linq;
// ' ...

DataContext dataContext = new DataContext(myConnectionString);
dataContext.Log = Console.out;