Take a database object information (as shown above, the red button)
Tip The physicist provider failed on The Open
InnerException tips
ORA - 12154: TNS: could not resolve the connect identifier specified
StackTrace details suggest the following
The at OracleInternal. ConnectionPool. PoolManager ` 3. Get (the ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)
The at OracleInternal. ConnectionPool. OraclePoolManager. Get (the ConnectionString csWithNewPassword, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)
The at OracleInternal. ConnectionPool. OracleConnectionDispenser ` 3. Get (the ConnectionString cs, PM conPM, the ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, OracleConnection connRefForCriteria)
At Oracle. ManagedDataAccess. Client. OracleConnection. The Open ()
Ats System. Data. The Entity. The proceeds. Interception. DbConnectionDispatcher. & lt; Open> DbConnectionInterceptionContext b__36 (DbConnection t, c)
Ats System. Data. The Entity. The proceeds. Interception. InternalDispatcher ` 1. Dispatch [TTarget TInterceptionContext] (TTarget target, Action ` 2 operation, TInterceptionContext interceptionContext, Action ` 3 executing, Action ` 3 executed)
Ats System. Data. The Entity. The proceeds. Interception. DbConnectionDispatcher. Open (DbConnection connection, DbInterceptionContext interceptionContext)
Ats System. Data. The Entity. The Core. The EntityClient. EntityConnection. & lt; Open> B__2 ()
Ats System. Data. The Entity. The proceeds. DefaultExecutionStrategy. Execute (Action operation)
Ats System. Data. The Entity. The Core. The EntityClient. EntityConnection. The Open ()
"
The Source hints EntityFramework
Tried the solution:
(1) check the web. Config the Connection String Connection String password and account number are correct, packaged application to other colleagues computer running project is no problem. Eliminate code and configuration file information error and oracle. Manageddataaccess. Client version is not corresponding.
(2) use the same computer and the same VS write a super simple console application (during the account of the differences of Web Server in a 64 - bit computer, also wrote a WebSite), the code is as follows, can be normal output system time, eliminate VS connecting Oracle.
[align=left] Oracle. ManagedDataAccess. Client. OracleConnection conn=new Oracle. ManagedDataAccess. Client. OracleConnection (" Data Source=(DESCRIPTION=(ADDRESS=(TCP) PROTOCOL=(HOST=00.00.00.00) (1555) PORT=) (CONNECT_DATA=https://bbs.csdn.net/topics/(SERVER=DEDICATED) (111111) SERVICE_NAME=)); USER ID=222222; Password=123456 ");
conn.Open();
String s;
Using (conn)
{
Oracle. ManagedDataAccess. Client. OracleCommand CMD=conn. CreateCommand ();
Cmd.Com mandText="select sysdate from dual";
S=CMD. ExecuteScalar (). The ToString ();
}
Console. WriteLine (s);
Console.ReadLine(); [/align]
(3) a blogger said in a 64 - bit Oracle 11 g computers don't identify C: \ Program Files (x86) the parentheses, to modify the bracket, didn't try this one, because I couldn't find bloggers.
(4) check the firewall, in the company domain, exclusion, colleagues can open the same project code, firewall and driver.
(5) the PL/SQL Developer can open the Oracle query...
One great god have ideas to provide it for me? Thank you.
CodePudding user response:
Error message is clear:ORA - 12154: TNS: could not resolve the connect identifier specified
Note:... TNS.. Said, is the problem of TNS, TNS configuration is wrong, so, the configuration is wrong, this also explains why others line, you can't, because other people's normal configuration, you have a configuration problem,
CodePudding user response:
The