Saturday, May 30, 2009

Easiest way to build connection string

Hey friends.
Most of the time, when a connection string is required, developers write it either manually, or use visual studio wizard from somewhere take make visual studio slower. So here is a quick fast way to do it. Let's build it more faster and easier way.
  • Right click on desktop and create a new text document, say cn.txt
  • Open that document and save it with .udl extension, cn.udl.
  • save and close the file
  • you will notice the file icon is now changed
  • double click the icon.
  • that will open a connection string dialog, same as you see in visual studio.
  • choose provider, enter other details acoording to your provider and just test connection and click on ok
  • right click that file, and open it in notepad. The file will contain connection string.
  • Copy the connection string and use it anywhere you want.

Happy coding :)

1 comment:

  1. Just thought you might like to know about an alternative method - using the online sql connection string generator on Devfusion. It only works for SQL server/express at the moment but it makes things nice and simple :)

    ReplyDelete

Please add your valuable comments about this post if it helped you. Thanks

Popular Posts