I have this website application I've been working on, VB.NET .NET 3.5, everything works fine. I also need to develop a console application that updates the website's database. I use an Oracle 10g database.
I copied the same connection class I use on my main project, when I try to call the connection method I get this error:
The ConnectionString property has not been initialized.
Or this error if I don't use the class and call the code directly:
The 'OraOLEDB.Oracle' provider is not registered on the local machine
I have no idea why, the same connection works right now on my other project.
My connection class:
Public Class connection
Public con As New OleDbConnection
Public Sub connect()
con = New OleDbConnection
con.ConnectionString = "Data Source=localhost;User Id=system;Password=root;Provider=OraOLEDB.Oracle"
End Sub
End Class
And when I call it:
connection.con.Open()
sql.Connection = connection.con
sql.CommandText = ...
sql.CommandType = CommandType.Text
reader = sql.ExecuteReader()
While (reader.Read())
...
End While
connection.con.Close()