I'm trying to do a connection on C# with Oracle on Visual Studio 2015, and at first I had this error "could not load file or Assembly Oracle.DataAccess" then I did a lot of stuff to solve it until I found the "32-bit Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio" and the problem did not appeared anymore but when I tried to Open the connection it started to appear this problem "ORA-12154 TNS: could not resolve the connect identifier specified"
I'm stuck and don't know what to do, I can connect to the database through sqldeveloper, so I think that the listener is fine.
Here the function:
public void openDatabaseConnection()
{
string oradb = "Data Source=ORCL;User Id=system;Password=32310813Np;";
OracleConnection conn = new OracleConnection(oradb);
conn.Open(); <-- ORA-12154
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "select USERNAME from FDB_USER where id = 1";
cmd.CommandType = CommandType.Text;
OracleDataReader dr = cmd.ExecuteReader();
dr.Read();
ViewBag.QueryResult = dr.GetString(0);
conn.Dispose();
}