Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connection string and SID

415437May 10 2004 — edited May 10 2004
Hello 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2004
Added on May 10 2004
3 comments
1,034 views