- Open LinqPad and click "Add connection".
- Click "View more drivers".
- Scroll down to find Dynamics CRM driver, then click "Download & Enable Driver".
- Once download completed, you see the driver in your list.
- Select the installed driver and click "Next".
- In the pop-up windows, you have several options.
- If you already have an application registered to Azure AD, then uncheck the "Register to Azure AD automatically... " then you can enter your own ClientId.
- If you want to use different version of API, check "Advanced Settings" and enter the API version. At the moment, v9 endpoint didn't work well, so enter "8.2" instead.
- Click "Login to CRM" then signin dialog appears. Specify your credential and login.
- Once login completed, wait until progress bar complets. It may ask you another credential to register an application to Azure AD if you let the driver register it on your behalf, then enter credential which has privilege to register an application to Azure AD.
- When it download metadata and create context, you see the window below. Click Exit and wait until entites are loaded. It may take several seconds to minutes.
- When everything done, you are ready to run LINQ query against your Dynamics instance.
![Loaded.png](.\images\Loaded.png)
- From Connection dropdown, select a connection you want to execute the query by either press F5 or click green arrow.
![SelectConnection.png](.\images\SelectConnection.png) 1. Enter LINQ query and execute. The results are shown in "Results pane"
![AccountQuery.png](.\images\AccountQuery.png)
- Switch language from "C# Expression" to "C# statement".
- Enter any statement you want to run and execute it.
- Select "SQL" tab to see URI to run the query.
- When you need to update/refresh the context, then right click the connection and select "Refresh".
- If you want to re-enter password or change setting, select Properties instead.
- Select any option as you want.
Ken