I have this code:
string conStr = @"server=ORACLE1001;database=Test;uid=admin;pwd=1234";
mycon = new OleDbConnection();
mycon.ConnectionString = ConStr;
and it throws exception that provider must be like "Provider=SQLOLEDB;"
so I tried with conStr = "Provider=OraOLEDB.Oracle.1;server=ORACLE1001;database=Test;uid=admin;pwd=1234;
and it throwed exception "ORA-12560: TNS:protocol adapter error" - anny ideas how to fix this? Any ideas what is wrong with my conStr?
Please follow the steps and then you will never worry about connection strings for any DBs(including access and excel)!
(1) create a new empty foo.txt
(2) rename it to foo.udl
(3) double click the file, you will see a wizard, with a few tabs and options
(4) do what you want, at last click OK
(5) open foo.udl with notepad(or rename it back to foo.txt)
(6) you can see the most standard connection string in the world