I have a simple form in Visual Studio 2010 that connects to Oracle database. And it WORKS.
Im using Windows XP and the Oracle is on a remote window server. However when I try to Add a data connection to the project: I get either:
ORA-12560: TNS:protocol adapter error.( If I leave the source as Local Database)
ORA-12154: TNS:could not resolve the connect identifier specified ( If I change datasource to "jerry_apps"- which is what it is called in tnsnames.ora)
I copied the tnsnames.ora into the different directories to keep it the same. I even configured an "Oracle Listner".
However I cannot get a connection of the database to the project.
====== Code below WORKS ===
Dim oradb As String = "Data Source=" _
+ "(DESCRIPTION =" _
+ " (ADDRESS_LIST = " _
+ " (ADDRESS = (PROTOCOL = TCP)(HOST = jerry.ces.uaex.edu)(PORT = 1521)) " _
+ " ) " _
+ " (CONNECT_DATA = " _
+ " (SERVICE_NAME = APPS)" _
+ " ) " _
+ " );User Id=accountt;Password=my_pwd; "
Dim conn As New OracleConnection(oradb)
Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandText = "select cit2 from wild9 where zipl=72055"
cmd.CommandType = CommandType.Text
Dim dr As OracleDataReader = cmd.ExecuteReader()
Label1.Text = dr.Item("cit2")
<b>SOLVED</b> Not sure if I needed to, but I reinstalled Visual Studio 2010. Also reinstalled ODTwithODAC1120320_32bit. Then I copied TNSNAMES.ORA and SQLNET.ORA over to C:\app\shall\product\11.2.0\client_3\Network\Admin