[?] A database connection problem
Project in ASP.Net 1.1, I am using VS.net 03, and Oracle 9i( i don't know what version) both loaded in WindowsXP SP2.
Now the problem is that, in the code I had to build a connection for the database. In that I got an error, where the dataAdapter Fills the dataSet.
The code runs perfectly, while I use an MS Access database. And connecting string was also changed accordingly while I tried to fetch data from oracle 9i. But that time it didn't work, and I got that error.
-------------------------------------------------------------
THE CODE:
Function GetCategories() As System.Data.DataSet
Dim connectionString As String = "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=SCT;Persist Security Info=True"
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString )
Dim queryString As String = "select [sub_name], [sub_id] from [SUBJECT]"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
Try
dataAdapter.Fill(dataSet)
Catch
Response.Write("<br /><br />ERROR: " & Err.Description)
Finally
dbConnection.Close()
End Try
Return dataSet
End Function
------------------------------------------------------------------
Now I tested the connection (using an .udl file and also using the âserver explorer > connect databaseâ in VS.net.) but I got the error:
âTest connection failed because of an error in initializing provider. Oracle error occurred, but error message could not be retrieved from oracle.â
Provider: Microsoft OLEDB provider for oracle
Server name: SCT
I can connect and run oracle from SQL Plus or Worksheet, provided with the oracle. And except this problem VS.Net is running properly.
Now what could be the problem in creating the connection?
Is Oracle not properly installed?
Is there any way of fixing this problem without uninstalling and reinstalling oracle?
Is Oracle is suitable for ASP.Net applications?
Aritra Mukherjee,
CS-4th Year,
MSIT-Kolkata.
__________________
Aritra Mukherjee,
CS-4th Year,
MSIT-Kolkata.
|