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.
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
How to make
- Make a text file, open it.
- Click on Save As.
- Write filename as something.udl, file type All files, click Save.
- Now run something.udl.
- Click on Provider tab. Select the provider and click Next.
- Give the DataBase Path, Give Username, Password, if any.
- 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=" +
An alternate way of doing it is as follows:
DataGridView in your Form.
DataSource by browsing, do the Settings, once all done, don't click OK, go back to the first step by clicking Previous.
- Click on Show Connection String.
- 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: