Setting up Database Connection Strings
Most of the times its very difficult to remember the database connection string attributes, to be specific when you are required to write a live program during an interview, its very odd to copy paste or refer Google for database connection string formats.
I have used one trick in the past found it to be very useful..just follow following quick steps:
- Create a text file on your desktop and rename it as test.udl.
- Click on it to open following window.
Now Just click on 'Provider' tab and select appropriate provider.
Then click Next and in 'Connection' tab,
- Specify source of data i.e. server name.
- Specify the credentials.
- Enter initial catalog i.e. database name.
Now click 'Test Connection' and it should succeed provided you entered right values above.
Now after closing the window, you can just open the file with a notepad to grab connection string. (reference : msdn).