Connection string and SID
415437May 10 2004 — edited May 10 2004Hello All,
I add a connection using the Oracle Net Manager. the SID is called SAURABH and the connection is also called SAURABH. When I test this, the connection test is successful for 'scott' 'tiger'. I look into the tnsnames.ora file and I can see the details added as
SAURABH =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = sparkhi)(PORT = 1521))
)
(CONNECT_DATA =
(SID = SAURABH)
)
)
In my application I generate a connection string as follows :
"User Id=scott;" + "Password=tiger;" + "Data Source=SAURABH"
When I try and use this connection string, I get an error saying "cannot resolve SERVICE_NAME"
If I use the complete connection string specifying PORT, PROTOCOL, HOST and SID and not use the tnsnames.ora file, it works fine.
Can anybody tell me whats wrong with this?