I am new to oracle and trying to just connect to oracle db, but I'm not sure where to find the correct credentials to enter the connection string. I just downloaded and installed oracle express edition on my machine and then installed .Net links. My simple code is here:
string oradb = "Data Source=XE;User Id=hr;Password=hr;";
OracleConnection conn = new OracleConnection(oradb);
try
{
conn.Open();
string sql = "SELECT FIRST_NAME FROM EMPLOYEES WHERE EMAIL='SKING'";
OracleCommand cmd = new OracleCommand(sql, conn);
cmd.CommandType = CommandType.Text;
OracleDataReader dr = cmd.ExecuteReader();
dr.Read();
label1.Text = dr.GetString(0).ToString();
}
catch (OracleException ex)
{
label1.Text = ex.Message;
}
finally
{
conn.Close();
}
I get TNS: Failed to resolve the specified connection id exception. Probably because my connection string is incorrect, this is what I guess. I can’t even go to the Server Explorer dialog box in Visual Studio and correctly check the connection to my version of oracle db.
, ?
...
oracle express , .Net-, ?