1 Reply Latest reply: Apr 13, 2014 11:00 AM by Alex.Keh .Product.Manager-Oracle RSS

    Visual Studion to Oracle Server connection

    794536

      Hi,

       

      I am trying to connect to oracle database on a remote server using my web service written in asp.net 3.5.

      I have installed ODAC provider tools and added oracle.dataaccess.dll as reference in my web service.

      Below is my connection string,

       

      <add name="connString" connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1526)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=PROD)));

      User Id=uName;Password=pwd;" providerName="Oracle.DataAccess.Client"/>

       

      and the webmethod in my webservice just tries to connect to the above server

       

      [WebMethod]

              public string TestConnection()

              {

                 

                  OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["connString"].ToString());

                  try

                  {

                      conn.Open();

                  }

                  catch (Exception ex)

                  {

                      throw ex;

                  }

                  return conn.State.ToString();

       

       

              }

       

      I get 500 internal server error when i invoke the above web method.

       

      Please help me