You can use the same TNS alias, username, and password to connect your .NET Core application to ADB.
Follow the below instructions to run the sample code in VS Code.
- Install the VS Code C# extension if running the app from VS Code.
- In the VS Code Terminal window, change to a directory to place your project files, such as using the "cd <directory location>" command.
- Run “dotnet new console” from the command line to create a new project.
- Run “dotnet add package Oracle.ManagedDataAccess.Core -v 2.19.70” from the command line to add ODP.NET Core to the project.
- Open program.cs and copy the ODP.NET Core sample code contents to this file and save.
- Configure the sample code to connect to your ADB instance. Provide values for the following:
- User Id (i.e. ADMIN)
- Password (i.e. ADMIN password)
- Data Source (i.e. mydb_high)
- OracleConfiguration.TnsAdmin (i.e. directory ADB credentials were unzipped to)
- OracleConfiguration.WalletLocation (i.e. directory ADB credentials were unzipped to)
- Execute the app by running “dotnet run” from the command line. You should see the database version number output as a result. Congratulations! You connected to Oracle Autonomous Database.
Note: All ODP.NET Core versions support connecting to ADB.