Within Visual Studio 2008, when debugging a LINQ to SQL program, we can use the traditional either of the Watch or QuickWatch windows to inspect a variable. For example, after the following line is executed, we can right-click on the products variable, and select QuickWatch … or Add Watch to see the contents of this variable:
var products = from p in db.Products where p.CategoryID == 1 select p;
The QuickWatch window will look like this:
We can also hover our mouse over the products variable, and wait for the Quick Info pop-up window to appear, and then inspect it on the fly. The pop-up Quick Info window will appear as shown in the following image:
In the Watch window, we can inspect the returned result of the variable, its properties, and even its children.