vb_newbie_2010
New member
- Joined
- Jun 15, 2010
- Messages
- 1
- Programming Experience
- Beginner
Hello Everyone,
First time poster I apologize in advance if any of my verbage is not correct.
I am using visual basic 2010, specifically vb.net, on a Windows 7 machine. I have created a form project, in which I attempt to connect to a remotely hosted database (meaning the db exists on a server elsewhere) using the following code, which I just took from a tutorial on connecting to an Oracle db:
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 have several questions.
1. If you can answer this one disregard the rest, Would anyone mind providing an example of how exactly I can connect to the db?
2. Do I need to install the oracle client on my loacl machine and add a reference of some type? If so would anyone mind explaining how this may be accomplished, the reference that is?
3. Do I need to use the administrator tools from the OS to add an Oracle driver via the data source administrator? If so I encounter the following error:
The Oracle client and networking components were not found...
Thanks a ton in advance for any help at all you may wish to bestow upon this lost soul
First time poster I apologize in advance if any of my verbage is not correct.
I am using visual basic 2010, specifically vb.net, on a Windows 7 machine. I have created a form project, in which I attempt to connect to a remotely hosted database (meaning the db exists on a server elsewhere) using the following code, which I just took from a tutorial on connecting to an Oracle db:
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 have several questions.
1. If you can answer this one disregard the rest, Would anyone mind providing an example of how exactly I can connect to the db?
2. Do I need to install the oracle client on my loacl machine and add a reference of some type? If so would anyone mind explaining how this may be accomplished, the reference that is?
3. Do I need to use the administrator tools from the OS to add an Oracle driver via the data source administrator? If so I encounter the following error:
The Oracle client and networking components were not found...
Thanks a ton in advance for any help at all you may wish to bestow upon this lost soul
Last edited: