How to connect to oracle Database from C# Code deployed within docker using wallet file

Patil,B,Basappa 0 Reputation points
2023-08-23T05:07:38.6266667+00:00

Hi All

We are currently working on establishing a connection to an Oracle database from a C# application using the Oracle.DataAccess.Client library. However, we are encountering difficulties when attempting to connect using a wallet file. Our application is an ASP.NET Core MVC application that has been deployed as a Docker image.

If you could provide any documentation, references, or guidance on the correct format for the connection string and how to reference the wallet through Oracle.DataAccess.Client, it would be greatly appreciated. Your assistance in resolving this issue would be invaluable to us.

Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | .NET | Other
Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Baris Saritas 0 Reputation points
    2023-08-28T20:41:05.81+00:00

    Oracle published the official Data Provider for .NET Core on nuget.

    using Oracle.ManagedDataAccess.Client;
    
    public void Execute(string queryString, string connectionString)
    {
        using (OracleConnection connection = new OracleConnection(connectionString))
        {
            OracleCommand command = new OracleCommand(queryString, connection);
            command.Connection.Open();
            command.ExecuteNonQuery();
        }
    }
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.