Click here to Skip to main content
15,881,044 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi guys, i need to connect to oracle database with c# application trough tunnel,
with the tunnel, in the connection string i need to connect to localhost:9090, but whatever i try to connect the application is trowing error at connection.Open(); function.

usings:
C#
using Oracle.DataAccess.Client; 
using Oracle.DataAccess.Types;


ERROR:
C#
An unhandled exception of type 'Oracle.DataAccess.Client.OracleException' occurred in Oracle.DataAccess.dll

Additional information: External component has thrown an exception.


the code is:
C#
string DBC = "User Id=SCHEMANAMEHERE;Password=PASSHERE;Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=9090))(CONNECT_DATA=(SID=orcl)));";
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(DBC);
            Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand();

            try
            {
                conn.Open();
            }
            catch (OracleTypeException ex) { System.Windows.Forms.MessageBox.Show("ERROR: " + ex.Message); }
            cmd = new Oracle.DataAccess.Client.OracleCommand(" select * from KLIENT;", conn);
            cmd.ExecuteNonQuery();

on conn.open the application is trowing unhandled exception which i cant catch with Exception, OracleExcpetion, OracleTypeException ... so what should i do?! i need this app very fast to finish but im still strugiling with this problem for about 2 days now....
thanks in advance.
Posted
Comments
Richard MacCutchan 1-Feb-15 7:11am    
The message tells you that an external component has thrown the initial exception, so you need to find out why. Have you checked the Oracle logs in both client and server?
SrgjanX 1-Feb-15 7:53am    
i dont have access to the server files nor i can find the logs files in my oracle client software installation directory... :/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900