Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: .NET3.0 C#3.0 Oracle
using System.Data.OracleClient;
string strDSNcon = "Data Source=myOracleDB;uid=uid;pwd=myPass;";
OracleConnection oraConn = new OracleConnection(strDSNcon);
myOracleDB version is 11.2.0 - 64bit
when I try to execute this code, it throws an error-
ORA-12154: TNS:could not resolve the connect identifier specified
at System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc)
I googled this error and there are a lot of possible cause. but nothing is applied in this scenario.
Is this problem of Oracle 64bit?
Posted 2-Sep-12 23:12pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi ,
Make sure you add reference Oracle.DataAccess
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

                string oradb = "Data Source=(DESCRIPTION="
                + "(CONNECT_DATA=(SERVER=DEDICATED)(;"
                + "User Id=scott;Password=123;";

                OracleConnection con = new OracleConnection(oradb);
Best Regards
Manas Bhardwaj at 3-Sep-12 6:23am
Yes 5!
Mohamed Mitwalli at 3-Sep-12 6:27am
Thanks Manas

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 /\jmot 210
1 Richard Deeming 195
2 Richard MacCutchan 190
3 Zoltán Zörgő 175
4 Peter Leow 170
0 Sergey Alexandrovich Kryukov 9,328
1 OriginalGriff 6,831
2 Peter Leow 4,477
3 Zoltán Zörgő 3,984
4 Richard MacCutchan 2,832

Advertise | Privacy | Mobile
Web03 | 2.8.150129.1 | Last Updated 3 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100