I use this C# code to make the OleDB connection to my access database :
OleDbConnection connection;
connection = new OleDbConnection();
connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.16.0; Persist Security Info=False; Data Source=" + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\Database.accdb");
connection.Open();
The problem is that instead of starting the relative path from the application folder as designated by "AppDomain.CurrentDomain.BaseDirectory", it starts the relative path from the visual studio installation directory.
This obviously causes the following error :
Why does it do that and where in my project settings or other visual studio settings can I set the correct path of my VS project ?
Thanks in advance,
Lantha