Wednesday, April 30, 2008

LINQPad - The Must Have Tool

I mentioned a couple weeks ago during my live blogging of Deeper in .NET that I was surprised that the LINQ discussions didn't utilize a utility called LINQPad.  I thought it would be worthwhile for those of you unfamiliar with the tool to write a little bit more about it, just to emphasize the importance of downloading it.  LINQPad is essentially a better version of SQL Management Studio, except instead of using raw SQL to query your database, you can use LINQ snippets.  There are some pretty sweet features in my opinion.

Ability to Navigate Foreign Key Relationships:  When you add a database connection similar to what you might do in SQL Management Studio, it shows you all the foreign key relationships with a hyperlink.  That means that when you click on the relationship, it automatically takes you to that table so you can view.  You can then see all the parent relationships so you can navigate back.

Ability to View Lambda and SQL Code:  After you've written a LINQ query, you can change the output view to show the resulting lambda version of your query, and also the resulting SQL code that gets executed.  This is invaluable as a learning tool for one, so you can see exactly how lambda expressions expand, but also to ensure that the resulting SQL is what you expect.

Ability to Run Other .NET Code:  This isn't just for querying.  You can include more complicated code in there as well, with looping structures and conditionals as well.  This gives you the opportunity to really write code snippets and test the output before you include it into your larger .NET projets.

I've really only just scratched the surface of what you can do with LINQPad.  Really you just need to download it.  It's a single executable that doesn't even have an installer.  The author of the program believes that anything with the word "pad" in the name should only require a single executable.  The only prerequisite is the .NET Framework 3.5.

O'Reilly also had a webinar more than a month ago (MOV format) with a live video demonstration of some of the cooler features which you can watch.  I highly recommend you do, so you can see some other cool features available.

#    11:24 AM by Nick | No Comments |