2

Hi I have to connect to an Oracle Database( about which I know a little) using a windows application. The windows application will not necessarily be in the same system. I just needed the connection string. So I Used Add connection functionality in Visual Studio 2014 to test the connection and get the string. eedb is the SID which i read in stackoverflow question

enter image description here

Now using above, i was able to connect to the database using this functionality and even in my visual studio server explorer all the tables of the oracle database were showing but I needed to use the connection string in the windows application. So I used following string:

DATA SOURCE=172.31.8.21:1521/eedb;USER ID=PDB_E_GND_R

I added password too to this string as

DATA SOURCE=172.31.8.21:1521/eedb;USER ID=PDB_E_GND_R;PASSWORD=123

when i run the application i get error.

System.Data.OracleClient.OracleException: ORA-01017: invalid username/password; logon denied.

So : Why I am getting this error. Now some may mark this question as duplicate and even point out the answer can be found in issue stackoverflow question

Coz if this was the case I would have been unable to establish connection through add connection functionality of Visual Studio at all. Please note: I added the reference: Oracle.DataAccess

And also for a programmer like me who has very little knowledge regarding the oracle. How I can know which connection string I have to use for a particular oracle db.

Community
  • 1
  • 1
Silver
  • 443
  • 2
  • 12
  • 33

1 Answers1

1

Try the following connection string EZ connect does not seem to be so EZ

data source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.8.21)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = eedb)));USER ID=PDB_E_GND_R;PASSWORD=123

Stuart Smith
  • 1,931
  • 15
  • 26