This is one of the very common error we use to get while using Oracle database. The error “The underlying provider failed to open” is bit confusing if you are not able to view the inner exception.
Once you get the exception, just expand the exception try to read the inner exception. Whihc will be more clear than this.
I just exapanded the exception and the actual error we get is “ORA – 12154: TNS:could not resolve the conect identifier… ” If you read this exception it will be more clear and you might know what needs to be done.
Below is the screen print of the error.
I assume you have installed Oracle client in your machine. This error just because you missed the 3 required files
1. tnsnames.ora
2. sqlnet.ora
3. ldap.ora
So in order to resolve the error “ORA – 12154: TNS:could not resolve the conect identifier…” you have to copy three files to the oracle installation location.
Oracle installation folder may vary depends on where you have installed the software and the windows version.
I have given you two possible location normally oracle get installed.
C:\app\client\<Userid>\product\12.1.0\client_1\network\admin
or
C:\Oracle\product\12.1.0\client_1\Network\Admin
If you cannot find Network and Admin folder in Client_1 path you may create those two folders.
Now you try to run the code and see if the issue gets resolved or not.
I hope it helps you to resolve the issue.
Thanks you for visintg my blog.