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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to Oracle 9i from ASP.NET

Status
Not open for further replies.

conjurer111

Programmer
Aug 11, 2002
76
IN
Hi,

I need to connect to an Oracle 9i Database from ASP.NET. Although I can connect to the Oracle Database through SQL*Plus.

I have downloaded and installed the latest Oracle ODBC drivers for 9.01 from Oracle's website and it didnt help. Also I installed Microsoft .NET Oracle Client and it produced the same results.


I have included the following namespaces and am using the following connection string to connect to Oracle -


<%@ Page Language=&quot;VB&quot; Debug=&quot;true&quot; Trace=&quot;true&quot; %>
<%@ import Namespace=&quot;System.Data&quot; %>
<%@ import Namespace=&quot;System.Data.OleDB&quot; %>

szConStr = &quot;Provider=OraOLEDB.Oracle;Data Source=abc; User ID=xyz; Password=xyz123;&quot;


In ASP.NET however I get the following error -

ORA-12154: TNS:could not resolve service name

Stack Trace:


[OleDbException (0x80004005): ORA-12154: TNS:could not resolve service name]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
ASP.G3_ASPX.Page_Load(Object Sender, EventArgs E) in D:\timesheet\ts04\g3.aspx:50
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +725

What could be wrong. Please suggest. Thanks.
 
Hi
So you are saying that on the web server, you can run sqlplus and connect to xyz@abc with the password xyz123?

If not, then you need to edit your tnsnames.ora file on the web server.


Mark [openup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top