Click here to Skip to main content
Click here to Skip to main content

Get DataBase Connection Strings in Easy Way

By , 15 May 2011
 
In computing, a connection string is a string that specifies information about a data source and the means of connecting to it. It is passed in code to an underlying driver or provider in order to initiate the connection. Whilst commonly used for a database connection, the data source could also be a spreadsheet or text file.
The connection string may include attributes such as the name of the driver, server and database, as well as security information such as user name and password.(source wikipedia[^] )
 
UDL file can be used to generate connection strings easily.
 
How to make UDL file?
  1. Make a text file, open it.
  2. Click on Save As.
  3. Write filename as something.udl, file type All files, click Save.
  4. Now run something.udl.
  5. Click on Provider tab. Select the provider and click Next.
  6. Give the DataBase Path, Give Username, Password, if any.
  7. Click on Test Connection.
 
If it's OK, then close it now.
 
Now open udl file as text file, connection string will be there in the last line.
 
Following is the connection string format for Oracle:
 
private static string CONNECTION_STRING =
"User Id=myUserID;Password=myPassword;Data Source=(DESCRIPTION=" +
"(ADDRESS=(PROTOCOL=TCP)(HOST=myserver.server.com)(PORT=yourPort#))" +
"(CONNECT_DATA=(SID=yourSID)));"
 
An alternate of doing it is as follows:
  1. Add DataGridView in your Form.
  2. Provide DataSource by Browsing, do the Settings, once all done, don't click OK, go back to first step by clicking Previous.
  3. Click on Show Connection String.
  4. Copy it, and use where you want.
For more details with screenshots, see MY Article
Connection Strings[^].
 
Following are the links to websites which provide Connection Strings Format for various DBMS:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

dot net tech
Pakistan Pakistan
Member
I am programming learner.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionMy Vote 5professionalTharaka MTR12 May '13 - 10:29 
GeneralMy vote of 1membernikhil _singh19 Jul '12 - 23:27 
GeneralReason for my vote of 5 Hey Great tip Mr. KhanmemberPranit Kothari1 Feb '12 - 17:14 
GeneralReason for my vote of 5 Thanks!memberRC_Sebastien_C27 Jan '12 - 3:22 
GeneralReason for my vote of 5 Nice... My 5 memberTejas_Vaishnav10 Nov '11 - 0:07 
GeneralThanks a lot ! That's exactly what I was looking for. I kne...memberEric Ouellet11 Oct '11 - 3:06 
GeneralReason for my vote of 5 Maybe old hat to some. New to me.memberwbherdle13 Jul '11 - 7:31 
Generalthere is no article at link specified by you...... http://ww...memberPritesh Aryan16 May '11 - 0:18 
GeneralThanks for the tip. I've only seen this one time before; I ...memberKeith.Badeau1 Apr '11 - 8:34 
GeneralReason for my vote of 5 nice tipmemberjvillamil28 Mar '11 - 18:24 
GeneralDidn't see this posted yet, but someone might find it useful...memberTorrey Betts23 Mar '11 - 10:39 
GeneralReason for my vote of 1 Rehashed a thousand times on the web...mvpDave Kreskowiak2 Mar '11 - 9:12 
GeneralReason for my vote of 4 different kind of approach.memberKumar_P1 Mar '11 - 6:54 
GeneralReason for my vote of 5 it is something Different new i thin...memberbipin928 Feb '11 - 23:03 
GeneralRe: Actually, it's not rare at all. It's the most common method...mvpDave Kreskowiak2 Mar '11 - 9:11 
GeneralReason for my vote of 1 Doesn't add to the sum total of huma...memberdamnedyankee24 Feb '11 - 5:29 
GeneralReason for my vote of 5 I like itmvpRaviRanjankr17 Feb '11 - 20:20 
GeneralRe: Thnx dearmemberAbdur Rehman Raza Khan - dontumindit20 Feb '11 - 4:27 
Generalthnx dear, lets keep helping othersmemberAbdur Rehman Raza Khan - dontumindit17 Feb '11 - 0:49 
GeneralReason for my vote of 5 Very nice trick. My 5memberPravin Patil, Mumbai16 Feb '11 - 22:02 
QuestionI liked itmvpShivprasad koirala15 Nov '11 - 0:30 
Generalnice beginner tipmemberSimon_Whale24 May '11 - 6:01 
I would update your tip to include the beginner tag then I think its perfect. Just my 2cents
Nagy Vilmos wrote:
And eat bacon. Bacon's real important for 'puters.

 
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

GeneralA handy tip ...memberPeter Hayward21 Mar '11 - 13:24 
GeneralAnother useless articlememberdamnedyankee24 Feb '11 - 5:17 
GeneralRe: Another useless articlememberAbdur Rehman Raza Khan - dontumindit26 Feb '11 - 21:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 15 May 2011
Article Copyright 2011 by dot net tech
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid