Visualize your LINQ Queries

One of the biggest concerns/fears that developers new to object relational mappers (ORMs) have is "but what SQL code is it actually executing?" One of the really nice things about LINQ to SQL is that there's a way to see exactly what SQL code it is executing when you run your application within the debugger.

ScottGu's blog entry LINQ to SQL (Part 3 - Querying our Database) describes how you can visualize your LINQ queries. The entry describes:

  • How you can visualize each of the create, retrieve, update, and delete (CRUD) queries for products from the Northwind database
  • How to bind them to ASP.NET controls
  • How to queries that pages through your data

Starting with Beta2 of Visual Studio 2008 you can use a new LINQ to SQL visualizer plug-in to easily see (and test out) any LINQ to SQL query expression.

If you're interested in getting started with LINQ, you might want to check out the book Introducing Microsoft® LINQ.