1

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

kaione
  • 21
  • 1
  • 3
  • Did you also put sqlnet.ora file in this folder? – Wernfried Domscheit Aug 11 '15 at 16:00
  • @Wernfried No I didn't, after reading your comment I tried to put one and now I have the "ora-12154 could not resolve the connect identifier specified". I tried to connect via sqlDevelopper with the identifiers in tnsnames.ora and it works fine – kaione Aug 12 '15 at 08:17
  • @Wernfried, I installed Oracle Database to have access to tnsping, and it happened there were just unwanted charasters in my tnsnames.ora file so it couldn't be well parsed – kaione Aug 12 '15 at 14:35

1 Answers1

0

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

kaione
  • 21
  • 1
  • 3