Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODP .NET - Getting TNS error

544998Nov 9 2006 — edited Nov 1 2007
I am trying to develop a project in VB.Net using VS 2005. My company uses Oracle 10g for our production db.
I downloaded and installed the ODP files.
The first thing I did was try to set up a data connection for the project using the Data Source Connection Wizard. I selected Oracle, entered the server, username and password and received "ORA-12154: TNS could not resolve the connect identifier specified"
I tried a different route - coding the connection and opening it in the form load event. Here is my code:

Imports Oracle.DataAccess.Client

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim conn As New OracleConnection
conn.ConnectionString = "Password=password;User ID=username;Data Source=servername;Persist Security Info=True"
conn.Open()
Console.Write("Connection Opened")
conn.Close()
conn.Dispose()
End Sub

I get the same error.
I would appreciate any help with this as I can't go forward on my project with no database connection
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2007
Added on Nov 9 2006
5 comments
3,105 views