我在 .Net(3.5) C# 和 Oracle Express 10g 中开发应用程序。当我尝试连接到数据库时,出现此错误:
从我得到的 OracleConnection 对象,在 ServerVersion 属性中:
ServerVersion = 'conn.ServerVersion' produjo una excepción de tipo 'System.InvalidOperationException'
并且,在捕获中:
ORA-12154: TNS:could not resolve the connect identifier specified
我正在使用这个连接字符串:
Data Source=Angelo-HP/XE;User ID=MAPFRE;Password=123456;
我的 tnsnames.ora 已设置:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Angelo-HP)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
我的 sqlnet.ora 是这样的:
SQLNET.AUTHENTICATION_SERVICES = (NTS)
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, HOSTNAME)
任何想法为什么我无法连接?
谢谢。