Oracle.ManagedDataAccess not resolving alias in connection string

别来无恙 提交于 2019-12-09 03:46:12

问题


I'm getting the following error while trying to connect to an Oracle database from a new VB.NET 4.5 application

"ORA-00351: Network Library: Name-Value premature end of string"

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 being the said alias

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

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>

Didn't work either

Here is the tnsnames.ora file I am talking about

formation=
 (DESCRIPTION=
   (ADDRESS=
     (PROTOCOL=tcp)
     (HOST=*IP*)
     (PORT=*PORT*)
   )
   (CONNECT_DATA= 
    (SERVICE_NAME=*service*)
   )
 )

Thanks,

Matt


回答1:


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...



来源:https://stackoverflow.com/questions/31946158/oracle-manageddataaccess-not-resolving-alias-in-connection-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!