How can I deploy a .NET application that uses ODAC without installing the whole component to the user?

前端 未结 3 1115
暖寄归人
暖寄归人 2020-11-29 19:44

I have written a C# application that connects to an Oracle 10g database. Using Oracle Data Access Component 11.2 \"ODAC\", it works perfectly on my machine.

And now

3条回答
  •  一生所求
    2020-11-29 19:57

    Since this question was posted, the Oracle Managed Client is now available (provided by Oracle). I have been using it with no problems. Does not require hunting for DLL's or special configuration. Just add the package, modify configuration file, and you're set. NuGet Link and an article by Oracle about it..

    Since this client is written entirely in .NET Managed code, it's architecture independent and there is no need for external DLL's, installing an Oracle Client, or anything like that.

    You can install it in VS using Package Manager.

    Install-Package Oracle.ManagedDataAccess
    

    I've taken to putting this in the machine.config file (though it'll also work in web.config or app.config). I've found that this helps avoid conflicts with other drivers that may be installed:

    
        
            
              
              
              
            
          
    
    

    Then for your connection string:

     
    
    • IPORNAMEOFHOST= This is the IP address or DNS name of your server.
    • PORTNUM= This is the port number that Oracle is listening at. Typically 1521.
    • ORACLESID= The SID of the database you're trying to connect to.
    • ORACLEUSER= The username to use for the connection.
    • ORACLEPASSWORD= The password to use for the connection.

提交回复
热议问题