I am pleased to announce that we released “LINQPad 4 Drive for Dynamics CRM” on CodePlex.

What’s LINQPad?

LINQPad (http://www.linqpad.net/) is a great tool which you can write and execute LINQ query against many data sources, like SQL Server, Oracle or Web Services. In addition to LINQ query support, the tool also supports C#/F#/VB expression, statement block or program, to write and execute the code and code snippet.

What can you do with CRM Driver?

By using CRM Driver, you are able to run LINQ query against Microsoft Dynamics CRM organizations on the fly. Follow the steps below to try it out!

Install Driver to LINQPad

1. Download and install LINQPad if you don’t have it yet from http://www.linqpad.net/.

2. Go to https://linqpaddriverforcrm.codeplex.com/ and click “DOWNLOADS” tab, then download CRMLinqPadDriver.lpx file.

3. Open LINQPad and click “Add connection” link on top left.

image

4. Click “View more drivers…” button at the bottom of the page.

image

5. Click “Browse” button in the bottom of the page.

6. Select downloaded CRMLinqPadDriver.lpx file, then click “Open”.

7. Click OK.

image

Use the Driver

1. Select “Dynamics CRM Linq Pad Driver” in Choose Data Context and click “Next”.

image

2. Click “Login to CRM” button.

image

3. Login to your Organization at login screen.

image

4. Then it automatically start loading metadata and DataContext from selected organization. Wait until it’s done.

image

5. Once “Loading Data” completed, click “Exit”. Then LinqPad starts loading schema, which takes a bit of time. Wait until you see schema information on the left pane like below screenshot.

image

Write LINQ query and Execute

1. Firstly, select added connection from “Connection” dropdown on the top right.

image

2. Enter following query to query window.

image

3. Click “Play” button or press F5 key to execute query. You will see the result in result pane.

4. Click SQL tab in result pane, where you can find QueryExpression and FetchXML equivalent to LINQ query.

image

image

Write C# statement and Execute

In addition to LINQ query, you can write C# as well.

1. Click [+] tab to open new query window next to existing Query tab.

2. Select “Connection” again.

image

3. Select “C# Statement(s)” from Language dropdown.

image

4. Enter following statements and Execute.

image

“this” of above statement represents DataContext of your connection, which is CrmOrganizationServiceContext. Therefore “this” has all common method from OrganizationService, as well as methods from OrganizationServiceContext.

IntelliSense?

When you use free version of LINQPad, you won’t get IntelliSense, but if you purchase the license, it works like Visual Studio.

image

What’s next?

We would like to hear feedback from you!! As it’s open source, you are able to extend it to your own needs, or you can suggest/report bugs.

Ken
Premier Mission Critical/Premier Field Engineer 
Microsoft Japan