Oracle.ManagedDataAccess无法解析连接字符串中的别名 [英] Oracle.ManagedDataAccess not resolving alias in connection string
问题描述
尝试从新的VB.NET 4.5应用程序连接到Oracle数据库时出现以下错误
I'm getting the following error while trying to connect to an Oracle database from a new VB.NET 4.5 application
"ORA-00351:网络库:名称-值字符串的过早结尾"
"ORA-00351: Network Library: Name-Value premature end of string"
OracleConnection似乎无法解析我在连接字符串中输入的别名
It seems like OracleConnection is not resolving the alias I am putting in my connection string
Me.sCNX = "Data Source=" & sDSN & ";User ID=" & sUSER & ";Password=" & sPWD & ";Enlist=false;Pooling=False;"
sDSN是上述别名
我必须将tnsnames.ora文件放在一个自定义文件夹中,所以我试图将环境变量TNS_ADMIN添加到正确的目录中,没有太大作用
I have to put the tnsnames.ora file in a custom folder, so I tried to add the environment variable TNS_ADMIN to the right directory, didn't work much
我试图在app.config中放置一条设置行,以便像这样设置目录
I tried to put a setting line in app.config in order to set the directory like this
<oracle.manageddataaccess.client>
<version number="*">
<settings>
<setting name="TNS_ADMIN" value="E:\oracle_admin" />
</settings>
</version>
</oracle.manageddataaccess.client>
也不起作用
这是我正在谈论的tnsnames.ora文件
Here is the tnsnames.ora file I am talking about
formation=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=tcp)
(HOST=*IP*)
(PORT=*PORT*)
)
(CONNECT_DATA=
(SERVICE_NAME=*service*)
)
)
谢谢
马特
推荐答案
发生我只是忘记了sqlnet.ora文件以及tnsnames.ora文件中有不需要的字符的事实,因此无法很好地对其进行解析...
Happens that I just forgot the sqlnet.ora file and the fact that there was unwanted characters in my tnsnames.ora file, so it couldn't be parsed well...
这篇关于Oracle.ManagedDataAccess无法解析连接字符串中的别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!