There are two things which I as a consultant / developer come across many times. One is verifying connectivity to a database which is often a cause of production issues and second is creating valid connection string in the least amount of time. This is the way I do it. Hopefully it will be of help to you.

First of all forget that you have Visual Studio, SSMS or anything so big and fancy. You just want to get a connection string baked up pronto. I usually end up creating a .udl file. UDL which stands for Universal Data Link allows you to establish a connection and then stores the connection string in text format. Doing this is very simple. Create a file in any folder or desktop and call it test.udl.

Now double click the file and you’ll get a window where you can enter your connection properties.

 image

You can also select different providers.

image

Once you have filled in the information about your server, security and database just click on Test Connection to verify connectivity. Click OK to close the window.

To get a connection string with information you just entered just open the test.udl file in a text editor and you’ll see the connection string.

 image

That’s it. Simple and easy ninja style.

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>