Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.net with oracle

Status
Not open for further replies.

WILLISP

Programmer
Jan 13, 2004
5
US
I am using the following code in both a windows app and an ASP.Net app:

Private m_cmd As System.Data.OleDb.OleDbCommand
Private m_con As System.Data.OleDb.OleDbConnection

dim connectionString as String

connectionString = "Provider=MSDAORA.1;User ID=myId;Data Source=PRD1;"
Try
m_con = New OleDb.OleDbConnection
m_con.ConnectionString = connectionString
m_con.Open()
Catch ex As Exception
Throw ex
End Try

It works ok in the windows app, however, when running the ASP.Net App ( using IIS ), I get the following exception:

ORA-12154: TNS:could not resolve service name

What is causing this to work in a Windows App yet fails in the ASP.Net application? Any help is greatly appreciated.

Thanks,
Paul
 
I finally figured this one out. The problem was with the permissions of the asp.net user, it was not able to access the tnsnames.ora file.

The location of the tnsnames.ora file is specified in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE, the TNS_ADMIN key points to it. The asp.net user was unable to access the network share. For now I copied the tnsnames.ora file locally and changed the registry key to point there. It now works. However, I consider this a workaround. Does anyone know how to give the asp.net user ( running under IIS ) access to files on a network share?

Thanks,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top