Oracle 10g/VB.net 2010 - System.Data.OleDb Connection to remote db question
618276Jun 15 2010 — edited Jun 16 2010Hello I am brand new to the forum :) I am using an oracle 10g db hosted on a remote server and visual basic 2010 (specifically vb.net) on a windows 7 machine
I am attempting to establish a connection with the db using the default user with the code below:
Imports System.Data.OleDb
...
Dim myConnection As OleDbConnection
myConnection = New OleDbConnection("Provider=OraOLEDB.Oracle;" & "Data Source=servername:portNumber;" & "UserID=odb;" & "password=odb;" & "database=tnsname")
Try
myConnection.Open()
myConnection.Close()
Catch ex As Exception
MessageBox.Show("Connection Error")
End Try
...
Beleive it or not I continue to have the exception thrown :)
I tried to install the instant client on my machine but run into a roadblock on step 3, the roadblock neing I don't know what to do (maybe add library to the project? if so what is the name of the file in the client I need to add as a reference?):
1. Download the appropriate Instant Client packages for your platform. All installations REQUIRE the Basic package.
2. Unzip the packages into a single directory such as "instantclient".
3. Set the library loading path in your environment to the directory in Step 2 ("instantclient"). On many UNIX platforms, LD_LIBRARY_PATH is the appropriate environment variable. On Windows, PATH should be used.
4. Start your application and enjoy.
I have also tried to go though the administrator tools to data sources ODBC to set up a new driver but end up with an error message:
The Oracle client and networking components were not found...
So if anyone takes mercy on my poor soul my questions are:
1. does the connection string make sense for connecting to a remotely hosted db?
2. is the instant client installation a must and ifso do I need to add a reference to the project?
3. is adding the driver via data source administrator needed?
Thanks in advance