Home > Net >  MVC EF6 connecting Oracle prompt The physicist provider failed on The Open
MVC EF6 connecting Oracle prompt The physicist provider failed on The Open

Time:09-18

Computer is win 10, 64 - bit operating system, use the Visual Studio 2015 and Visual Studio 2017 opened the MVC EF6 project operation.


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
reference 1/f, the knights templar 18 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 the configuration of the others is normal, you have a configuration problem,


TNS. Ora file covers have direct access to the colleagues, and PL/SQL Developer can open. Then look at the help?

CodePudding user response:

Try
https://blog.csdn.net/wm5920/article/details/7328410

CodePudding user response:

reference EdsionWang reply: 3/f
try
https://blog.csdn.net/wm5920/article/details/7328410

Haven't set a set, I native PL/SQL Developer use.
It is Visual Studio open project running connection doesn't go to the Oracle.

CodePudding user response:

Your colleagues' writing can not use the connection in the tnsname, check your connection string is what, if is not the same as your colleague's format, please check the system the tns_admin and oracle_home environment variable, if it is other IIS application please use the command line to restart IIS or IIS will not automatically read the latest environment variables, not the clear place, please baidu, best wishes,

CodePudding user response:

Make sure no character error configuration files?
  • Related