In the last post (part 1) we have discussed about how to create UDL and how a basic connectivity check can be performed. Another cool thing about UDL is that it can help a developer to create connecting string for the selected provider. Here are the steps.
- Create a blank UDL file (Refer Part 1).
- On the first tab, choose provider. I have selected “SQL Server Native Client 11.0”
- Hit Next or move to next tab “Connection” and provide necessary values. I have given server name (SRV3), selected “Use windows NT integrate security” and typed in database name as tempdb.
- On “Advanced” tab, I have entered timeout as 60 (I have given some random number for demo)
- On last tab “All”, we can edit rest of the parameter which can be provided in connecting sting. I have used “Application Name” in below screenshot and edited it to Balmukund
- Once all necessary values are entered. Hit OK.
- Now, open the file with “notepad” and have a look (this is the key of the trick because double click would open properties again)
Notice that connection string is ready and can be used in the application code. Interesting? Please comment if it was useful.