The Query Visualizer is an assembly that can be used in a Visual Studio debug session to visualize database queries. The project itself is just a library, and cannot be run. If you compile it, a library (DLL) is generated that can be used in Visual Studio to enhance your ability to debug LINQ to SQL applications.

NOTE: When you are debugging applications with the Visualizer you may need to add "Persist Security Info=true" to the connection string. When the debugger is activated it serializes information from the program being debugged and sends it over to the process which displays the visualizer.  One of the pieces of information that is serialized is the connection string which is obtained from the SqlConnection object. By default, the SqlConnection object doesn’t return the password and therefore the connection string without the password is serialized and sent over to the visualizer.  When you attempt to execute the query in the visualizer it may fail because it doesn’t have the password.  Only use this setting when debugging. It isn’t recommended for production. 

To use the Visualizer the DLL generated by the LinqToSqlQueryVisualizer project must be copied to the ...\Documents\Visual Studio 2008\Visualizers directory. You may need to create the Visualizers directory. In pre-Vista versions of Windows use the My Documents directory rather than Documents. If you have the rights, you can also copy the file to: ...\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers.

Here is a step by step outline of what to do:

        public void SimpleQuery()
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            var query = from c in db.Customers
                        select c;

            foreach (var item in query)
            {
                Console.WriteLine(item.CompanyName);
            }
        }