troubleshooting Question

Use odp.net to connect to Oracle DB using .NET framework 2.0/3.5

Avatar of subhorachana
subhorachana asked on
Oracle Database.NET ProgrammingMicrosoft Development
1 Comment1 Solution1168 ViewsLast Modified:
Hello,

I am using Oracle Data Access Components (ODAC) Beta (from http://www.oracle.com/technology/software/tech/windows/odpnet/install1110710beta.html)
to connect to my oracle DB through ASP.NET.My .NET enviornment on prod can be 2.0 or 3.5
My Oracle DB is Oracle 10.2 g (This installs OraClient11g Client on my Program files)

I have a lot of questions regarding this:

1: Am I using the correct odp.net provider?or should I use some other version.Please provide the link if any other version is a better one.
2: Do I need to have an Oracle 10 g client installed to use odp.net or just installing the ODAc work fine?
3:On my dev box,I just have the ODAC and no Oracle client (hence no tnsnames.ora file on my dev box) and I am able to connect to the DB using the following connection string:

Conn string:
Data Source=(DESCRIPTION="
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<IP Address>)(PORT=1526)))"
+ "(CONNECT_DATA=(SID = dbname)(GLOBAL_NAME = dbname.WORLD)));"
+ "User Id=uid;Password=pwd;

On production , is it a good practice to pass the tns entry in code using the connection string format as above?or should I install the 10 g client, configure the tns entry, and pass just the UID, password and the database value using code?

3: On the connection string or tns entry, for the parameter HOST, if I pass the machine name (e.g. HOST=abcdefg4sg10), I am getting the following error message:
ORA-12545: Connect failed because target host or object does not exist

However, If I I pass the IP address of the machine (e.g. HOST=10.xxx.xx.xxx), then it is getting connected.

Please let me know the issue.I should not use the iP address as the DB are in cluster.

4; My last question is on the PORT.When installing the OADC the installation wizard asks for the port.I understand that the default port is 1521.But if I install using port 1521 and pass some other value for PORT parameter on the connection string, e.g. PORT = 1526, stilll it gets connected.
I wanted to understand the use of the PORT.

Please clarify my doubts.

Regards.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros