Oracle Client in Web application

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 1
Joined: Tue 06 Nov 2012 13:51

Oracle Client in Web application

Post by delia.berar » Tue 06 Nov 2012 14:04

could some give an example of how to connect to an Oracle DB from an ASP.NET web project using Oracle Client?
Thanks in advance.

Devart Team
Posts: 7972
Joined: Thu 14 Aug 2008 12:44

Re: Oracle Client in Web application

Post by Shalex » Wed 07 Nov 2012 10:48

Please refer to ... ction.html.
1. The OCI mode (connection via Oracle client) is used when the Direct connection string parameter is set to false (by default, it is false).
2. You can open a connection in the OCI mode from an ASP.NET project in the same way as it can be done from console application.
3. Make sure that capacity (x86 or x64) of the web server, on which you deploy your ASP.NET application, coincides with the capacity of your Oracle client.
4. The TNS alias name can be found in the tnsnames.ora file of Oracle client (%OracleHome%\NETWORK\ADMIN\tnsnames.ora).

Posts: 12
Joined: Fri 22 Jan 2010 15:39

Re: Oracle Client in Web application

Post by matthiasramp » Tue 14 Apr 2015 10:47

Sorry for revoking this old post.
Does the tnsnames.ora have to reside in %OracleHome%\NETWORK\ADMIN\tnsnames.ora? Why is the TNS_ADMIN Environment-Variable not used?
I'm having a couple of issues usig a tnsnames.ora which resides in a different Folder than %OracleHome%\NETWORK\ADMIN\tnsnames.ora and it seems it is not used.


Devart Team
Posts: 2105
Joined: Wed 02 Nov 2011 09:44

Re: Oracle Client in Web application

Post by Pinturiccio » Wed 15 Apr 2015 13:09

dotConnect for Oracle does not use tnsnames.ora directly. dotConnect for Oracle uses Oracle Client, which works with tnsnames.ora. By default Oracle Client looks for tnsnames.ora in the %OracleHome%\NETWORK\ADMIN\ folder. For Oracle Instant Client, the path to the tnsnames.ora file can be specified in the TNS_ADMIN environment variable. If you need more information about the locations of the tnsnames.ora file, please contact Oracle support.

Post Reply