C# oracle connectivity

  • Thread starter Thread starter DotNetJunkies User
  • Start date Start date
D

DotNetJunkies User

Consider a situation that i need to connect to a remote oracle database using a ASP.NET interface. I dont have the access to change the TNSname.ora file. In that case, how can i connect to oracle using the following information:
1. Network Address
2. Port
3. SID
4. User Id
5 Password

Java does allow this. But the .NET connection string using both ORAClient or Microsoft's Oracle native driver, doesnt allow me to do that.

Any body who can help me on this.?
 
I would try the ODP from http://otn.oracle.com.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
DotNetJunkies User said:
Consider a situation that i need to connect to a remote oracle database
using a ASP.NET interface. I dont have the access to change the TNSname.ora
file. In that case, how can i connect to oracle using the following
information:
1. Network Address
2. Port
3. SID
4. User Id
5 Password

Java does allow this. But the .NET connection string using both ORAClient
or Microsoft's Oracle native driver, doesnt allow me to do that.
Any body who can help me on this.?
engine supports Post Alerts, Ratings, and Searching.
 
DotNetJunkies User said:
Consider a situation that i need to connect to a remote oracle database
using a ASP.NET interface. I dont have the access to change the TNSname.ora
file. In that case, how can i connect to oracle using the following
information:
1. Network Address
2. Port
3. SID
4. User Id
5 Password

Java does allow this. But the .NET connection string using both ORAClient
or Microsoft's Oracle native driver, doesnt allow me to do that.
Any body who can help me on this.?

The entry in TNS.ORA is an alias for the junk that comes after the '='. The
MS driver has a bug limiting the length of the DataSource, but the Oracle
driver ODP.NET will allow you to put the whole TNS string into the
DataSource.


eg
for

mydb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = dbservice)
)
)

use

(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = dbservice)
)
)

David
 
Oracle is poor, largely due to that stupid Tnsnames.ora file. SQL server is a much better alternative.
 
Bonj,

Still anti-Oracle. I see you moved to .NET so you must have an open mind. Try Oracle before you put it down.

Just to be clear, given a choice I would use MSSQL, but not every developer has a choice.
 
David,

You don't need the ADDRESS_LIST. And the spaces are there just for
readability, they can go as well...

This works just as well:

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost)(PORT=1521)))(CONNECT_DATA=
(SERVICE_NAME=dbservice))

regards
roy fine
 
Back
Top