I'm trying to connect my application with an Oracle database using NHIBERNATE 3.1.0.4000 version and I got this error:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
I've already tried some connection strings and none of them work:
SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MySID)));uid=MyUser;pwd=MyPassword;
Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MySID)));User Id=MyUser;Password=MyPassword;
SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SID=MySID)));uid=MyUser;pwd=MyPassword;
Driver={Microsoft ODBC for Oracle};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SID=MySID)));Uid=MyUser;Pwd=MyPassword;
The properties I have are User, Password, Host, Port and SID. In other words, there is no TNS. My options is to connect directly.
Some informations may are important:
- I'm running it using a test project.
- I'm using VPN connection to database server.
- I can connect to the server via TOAD Client fine
- My project was built with .NET framework 3.5
- The oracle version is 9i
Installed binaries files:
- Castle.Core
- Iesi.Collection
- Nhibernate
- Nhibernate.ByteCode.Castle
- Oracle.DataAcess
Development enviroment is:
- Windows 7 64 bits
- Visual Studio 2010 Premium
hibernate.hbm.xml file content:
<?xml version="1.0" encoding="utf-8"?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="NHibernate.Test">
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="connection.connection_string">
SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SID=MySID)));uid=MyUser;pwd=MyPassword;
</property>
<property name="show_sql">false</property>
<property name="dialect">NHibernate.Dialect.Oracle9iDialect</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
</session-factory>
</hibernate-configuration>
Thank you all is advanced! I hope so much be helped!