.comment-link {margin-left:.6em;}
Gert .Net
The connection string to Oracle
Parts that make up the connection string:

This makes a connection string like this:

User ID=MyName;Password=Asecret007;Data Source=server_database

But actually this is the name in the TNSNames.Ora file that maps to a full blown connection string.

The TNSNames.Ora can be found (on my system):


You can built it using the Oracle Net Configuration Assistant. Choose "Local Net Service Name configuration" to Add, modify or delete.

I noticed that the OracleConnection fails when the Data Source is longer as 16 characters.


try {
using (OracleConnection con = new OracleConnection(
"User ID=MyName;Password=Asecret007;Data Source=server_database")) {
MessageBox.Show(this, "Connection successfull", "Success");
} catch (Exception ex) {
MessageBox.Show(this, "Connection failed\n" + ex.Message, "Connection failed");

Powered by Blogger