Hi,
I am developing a website using vs 2013 (C#) + devart dotconnect + oracle, my host does not have oracle cliente installed, so i need connect via direct mode.
<add name="DefaultConnection" connectionString="DATA SOURCE=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle.mydomain.com.br)(PORT = 1521))(CONNECT_DATA =(SERVICE_NAME = ORACLE)));User ID=user;Password=password;" providerName="Devart.Data.Oracle" />
i've seen on documentation to use Direct=true but i coudnt figure out how my connection shoud be.
Any suggestions?
Thanks in advance
Gilberto
Connecion string to use direct mode on oracle
-
- Posts: 7
- Joined: Mon 08 Sep 2014 12:19
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Connecion string to use direct mode on oracle
Your connection string defines an OCI mode connection. You need to make the following changes to create a Direct mode connection:
1. The 'Data Source' connection string parameter must specify the name of the computer running the Oracle server. In your case this is oracle.mydomain.com.br ;
2. The SID or 'Service Name' connection string parameter must specify the SID or Service Name respectively. In your case it must be 'Service Name=ORACLE';
3. Add 'Direct=true' to your connection string.
Thus, your connection string must be like the following:
For more information, please refer to http://www.devart.com/dotconnect/oracle ... tMode.html
1. The 'Data Source' connection string parameter must specify the name of the computer running the Oracle server. In your case this is oracle.mydomain.com.br ;
2. The SID or 'Service Name' connection string parameter must specify the SID or Service Name respectively. In your case it must be 'Service Name=ORACLE';
3. Add 'Direct=true' to your connection string.
Thus, your connection string must be like the following:
Code: Select all
<add name="DefaultConnection" connectionString="DATA SOURCE=oracle.mydomain.com.br;SERVICE NAME=ORACLE;Direct=true;User ID=user;Password=password;" providerName="Devart.Data.Oracle" />