Tuesday, March 18, 2008

It's Been A While

Having not touched this blog for around 3.5 years, I thought it might be time a made another appearance!

So, with my first blog entry in a while, I thought I'd start off with a mention of a really useful utility that I came across last week called LINQPad.

image

If you're into writing LINQ queries then this tool will really help your LINQ skills. LINQPad isn't simply a Notepad for LINQ though, it has some really cool features.

No Need To Install

Once you download LINQPad there's no installer to run, just run the EXE itself and off you go.

Database Connectivity and LINQ To SQL Features

In this screenshot I've configured LINQPad to connect to the AdventureWorks database on my SQL Server instance:

image

From here I can drag tables into the query editor and use those in my queries. LINQPad automatically takes care of the underlying database connecting for you. Check out this example which returns the Title column value for all records in the Employees table:

image

Note the use of the Dump() method call, this displays the content of j into the LINQPad console window. This query results in the following output:

image

A cool feature is the SQL button found here:

image

Pressing this button will give you the SQL syntax for the LINQ to SQL query in the editor:

image

This is just a taster of how handy this utility could be for you. Check it out.