Hi, I am trying to connect to oracle database 10 g using visual C# 2005. I am using ODP.Net for connecting to the database. I have configured .Net Configuration Assistant in the Programs->Oracle-OraDb10g_home1->Configuration and Migration Tools ->.Net Configuration Assistant. I have installed ODP.Net on my machine. I have referenced Oracle.DataAccess.dll (under dir client1) in the program ( in solution explorer ->add reference).Below is my code:
static void Main(string args)
string constr = "User Id=SYSTEM;Password=mskiranavk;Data Source=orcl";
OracleConnection con = new OracleConnection(constr);
Console.WriteLine("Connected to Oracle" + con.ServerVersion);
When I try to run these code I am getting an unhandled exception :ORA 12154 : TNS : could not resolve the connect identifier specified. I have tried to change the tnsnames.ora and listener.ora , however could not connect. Anyone please help me with this code. Its urgent...
thanks in advance