Yuvipoy

Yuvipoy

  • 1.8k
  • 7
  • 13.3k

Oracle connection in Odbc

Aug 30 2012 7:37 AM
using System.Data.OracleClient;            
            OracleConnection con = new OracleConnection();
            con.ConnectionString = "Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xx.xxx.xx.xxx)(PORT = 1522))(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = MYDB)));User Id=XXXXXX;Password=XXXXXX;";          
            OracleCommand myCommand = con.CreateCommand();
            
Success
            
using System.Data.Odbc;
            OdbcConnection con = new OdbcConnection();
            con.ConnectionString = "Driver={ Microsoft ODBC for Oracle };Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xx.xxx.xx.xxx)(PORT = 1522))(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = MYDB)));User Id=XXXXXX;Password=XXXXXX;";          
            OdbcCommand myCommand = con.CreateCommand();            
Failed

using System.Data.Odbc i am unable to connect to database of Oracle why what is the other format

Thanks!


Answers (2)