I have a windows forms app, in which I am trying to connect to Oracle 11g DB with OracleManaged driver, which ends with an exception "ORA-12154: TNS:could not resolve the connect identifier specified". However when I am trying to connect through ODP.NET 64bit dlls, it is connecting (for this I ensured building the app in x64). The sample code below. If I toggle to second statement, I am getting the error while opening the connection.
Oracle.DataAccess.Client.OracleConnection con = new Oracle.DataAccess.Client.OracleConnection();
//Oracle.ManagedDataAccess.Client.OracleConnection con = new Oracle.ManagedDataAccess.Client.OracleConnection();
con.ConnectionString = "Data Source=v3;User Id=xxx;Password=xxx;";
con.Open();
MessageBox.Show("Done");
con.Close();
Is there a setting I am missing? Even I tried with the configure.bat that came along with manaed ODP (64bit)
I got this worked by copying the tnsnames.ora file to bin folder. It seems like the managed driver couldn't find the right tnsname.ora file.