andreas domevscek

andreas domevscek

  • 2k
  • 21
  • 7.1k

Oracle Connection over ODBC

Sep 23 2014 5:51 PM



I want to connect with oracle database.
my Connection String in web.config:


<add name="ConStrOrcl" connectionString="Driver=ODBCDriver;Data Source=localhost:1521/orcl;User Id=uid;Password=pwd" providerName="System.Data.Odbc"/>


in webapp i have

string CS = ConfigurationManager.ConnectionStrings["ConStrOrcl"].ConnectionString;

OdbcConnection con = new OdbcConnection(CS);

OdbcCommand cmd = new OdbcCommand ("select Id, CityName, Country from nha.tblCity", con);


but when gives me an error
ERROR [IM002] [Microsoft][ODBC-stuurprogrammabeheer] De naam van de gegevensbron is niet gevonden en er is geen standaardstuurprogramma opgegeven  
Can someone give me the clue? 

Answers (2)