tentavarious
asked on
Cannot connect to oracle using OracleClient, asp.net
Hello experts, my web forms are on a windows2003 server, and I cannot connect to a Oracle 9i database using the Imports System.Data.OracleClient namespace. I have tried everything from setting Acount permissions, to restarting IIS and rebooting our server, nothing seems to work. My question is what other connection method can I use and how do I do it? I have read some where that the OracleClient may not be supported on windows 2003. I am using Asp.net version 1.1 with Visual Studio.net 2003
ASKER
I tried using this method and could not get it to work. Like I said above the OracleConnect (.net) didnt work. I ended up using a ODBC connection and it seemed to work. What is the best method? And using OLE DB what do i set the provider equal to?
This is how i got it to work.
Dim objconn As New OdbcConnection("Driver={Mi crosoft ODBC for Oracle};Server=databasenam e;Uid=sfdd ;Pwd=ddsf; ")
OLE DB, OleDbConnection (.NET)
-------------------------- ---------- --
Standard security:
"Provider=msdaora;Data Source=MyOracleDB;User Id=UserName;Password=asdas d;"
This one's from Microsoft, the following are from Oracle
Standard Security:
"Provider=OraOLEDB.Oracle; Data Source=MyOracleDB;User Id=Username;Password=asdas d;"
Trusted Connection:
"Provider=OraOLEDB.Oracle; Data Source=MyOracleDB;OSAuthen t=1;"
This is how i got it to work.
Dim objconn As New OdbcConnection("Driver={Mi
OLE DB, OleDbConnection (.NET)
--------------------------
Standard security:
"Provider=msdaora;Data Source=MyOracleDB;User Id=UserName;Password=asdas
This one's from Microsoft, the following are from Oracle
Standard Security:
"Provider=OraOLEDB.Oracle;
Trusted Connection:
"Provider=OraOLEDB.Oracle;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My odbc connection above worked fine. My problem was I couldnt get it to work with oledb. I was wondering what is the best method for connection to oracle database?
OLE DB, OleDbConnection (.NET)
--------------------------
Standard security:
"Provider=msdaora;Data Source=MyOracleDB;User Id=UserName;Password=asdas
This one's from Microsoft, the following are from Oracle
Standard Security:
"Provider=OraOLEDB.Oracle;
Trusted Connection:
"Provider=OraOLEDB.Oracle;
--------------------------
OracleConnection (.NET)
--------------------------
Standard:
"Data Source=MyOracleDB;Integrat
This one works only with Oracle 8i release 3 or later
Specifying username and password:
"Data Source=MyOracleDB;User Id=username;Password=passw
This one works only with Oracle 8i release 3 or later
Example:
---------------
C#:
using System.Data.OracleClient;
OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionStri
oOracleConn.Open();
VB.NET:
Imports System.Data.OracleClient
Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionStri
oOracleConn.Open()
-Nauman.