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 SkipVought 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.

meenakshidhar

Programmer
Oct 19, 2001
77
0
0
MY
I m not able to connect ASP.Net with Oracle. The code is given below-

=========================================================
Dim oOracleConn As OleDbConnection = New OleDbConnection()
oOracleConn.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=INDV;User ID=scott;Password=tiger"
oOracleConn.Open()
=========================================================

The error which i m getting is--
System.Data.OleDb.OleDbException: Class not registered

Can anyone pls help me out

Regards
Meenakshi Dhar
 
It seems you may have a problem with the .NET Framework. Are you having any other problems with any other classes?

If so, you could try running "aspnet_regiis -i" from the framework folder.

Also, there is an Oracle class for specifically working with Oracle databases. have a look at thread796-1065469 for more info.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Well, if i m connecting ASP.Net with SQL Server its wrking perfectly alright..I have oracle client installed on my machine..

how do we run "aspnet_regiis -i" from the framework folder. Could u pls explain it little further..
 
how do we run "aspnet_regiis -i" from the framework folder. Could u pls explain it little further..
Open a command prompt. Navigate to the .NET Framework folder. Type aspnet_regiis -i and press enter.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
i m still getting this error...

System.Data.OleDb.OleDbException: Class not registered
 
Have you tried using the System.Data.OracleClient class like I suggested?

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
ya i tried System.Data.OracleClient also..but still not able to connect..
 
And what does the System.Data.OracleClient class error with?

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Also, post the whole connection code that you are using with the System.Data.OracleClient class.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
this is the code--

Dim con As New System.Data.OracleClient.OracleConnection()
con.ConnectionString = "Password=tiger;User ID=scott;Data Source=INDV;"
con.Open()

and the error is--
OCIEnvNlsCreate failed with return code -1 but error message text was not available.
 
OCIEnvNlsCreate failed with return code -1 but error message text was not available.
I'm not sure what OCIEnvNlsCreate is...is this your own class? Also, you should be able to get an error message. Wrap the connection up in a Try/Catch and catch both a oracleclient exception as well (as you will then be able to see if the db has an error or if there is another error. e.g.
Code:
        Try

        Catch ex As Exception

        Catch exDb As OracleClient.OracleException

        End Try

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top