Oracle connection string without tnsnames.ora file

I am using the .NET framework with the System.Data.OracleClient namespace. I have the oracle 11 client installed on my computer. I do not want to use the tnsnames.ora file to store connection information.

Could someone please tell me what the connection string would look like if I did not want to use the tnsnames.ora file? I will be storing the connection string in a web.config file of a Web Application Project.


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Starting with 10g clients, you can use the EZCONNECT feature, which does not require to edit the TNSNAMES.ORA file : username/[email protected]:port/instance. For instance :

Data Source=localhost:1521/XE;Persist Security Info=True;User ID=scott;Password=tiger;Unicode=True

Method 2

This is a great resource


is what you want i believe…

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x