Bite my bytes

What I learn by day I blog at night - A blog from Microsoft Consultant working from Ljubljana, Slovenia

  Home :: Contact :: Syndication  
  999 Posts :: 7691 Comments :: 235 Trackbacks

Search

Most popular posts
in last 90 days

Categories

My Projects

Archives

Stuff


Copyright © by David Vidmar
 
Contact me!
 
LinkedIn Profile
 
 
 

I have been using an old trick with blank .UDL file to quickly write connection strings for years.

If you don't know what I'm talking about, try this:

  • Create new Text File. I usually do that on the Desktop for easy access.
  • Change the extension of the file to .UDL.
  • Double click the file and you get the Data Link Properties dialog.
  • Fill in data for you connection and finish with OK.
  • Rename file back to .TXT, double click it and it will open in Notepad.
  • There, in the second line is your connection string.

But last week I found old post about macro that simplifies this process a lot. Actually I found two similar posts teaching the same tricks. The macro makes Data Link Properties accessible right from your code in VS. Really neat trick.

Posted on Monday, November 14, 2005 8:25 PM | Filed under: Developement |

Feedback

# re: Creating connection string in VS 11/15/2005 9:00 AM Rasmus
.. or just take a look her: http://www.connectionstrings.com/


# re: Creating connection string in VS 11/21/2005 8:17 PM David
Nice hint, but I find the macro more handy!

# re: Creating connection string in VS 11/8/2010 6:43 PM Vision Technology Service
You can create a connection string through the usage of .udl file.

UDL File Creation :

1) Right-click on the desktop, or in the folder where you want to create the file.
2) Select New, then Text Document.
3) Give the Text Document any name with a .udl extension ("Show file extensions" must be enabled in folder options).
4) A window will pop up warning that "If you change a filename extension, the file may become unusable. Are you sure you want to change it?" Select Yes.
5) You have now successfully created a UDL file.

Now you need to implement the settings inside the .udl file according to your requirements. A video tutorial has been provided to explain you the whole procedure of using .udl file to create a connection string for MS SQL Server.

http://visiontechno.net/studymats/udlcreation.html

# re: Creating connection string in VS 11/8/2010 6:44 PM Vision Technology Service
You can create a connection string through the usage of .udl file.

UDL File Creation :

1) Right-click on the desktop, or in the folder where you want to create the file.
2) Select New, then Text Document.
3) Give the Text Document any name with a .udl extension ("Show file extensions" must be enabled in folder options).
4) A window will pop up warning that "If you change a filename extension, the file may become unusable. Are you sure you want to change it?" Select Yes.
5) You have now successfully created a UDL file.

Now you need to implement the settings inside the .udl file according to your requirements. A video tutorial has been provided to explain you the whole procedure of using .udl file to create a connection string for MS SQL Server.

http://visiontechno.net/studymats/udlcreation.html

# re: Creating connection string in VS 3/22/2011 10:13 PM James Crowley
You might also want to try the SQL Connection string generator on Devfusion. It's only for SQL Server/Express right now but makes things nice and easy.

Comments have been closed on this topic.