1
I am making a program using C# in WPF, and I need to access the database dynamically, in this case I am using a .mdf.file. In code I have connectionString like this:
string stringConexao = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=E:\PAP\Trabalhos\Trabalhos\Trabalhos.mdf; Integrated Security=True";
I want to replace "E: PAP Jobs Jobs Jobs.mdf" with a dynamic way to find the database, so I can then use the program outside my computer.
The first " Jobs " corresponds to where is the "Jobs.sln", the other folder "Jobs" and "Packages". In the following folder is where you have all . Cs, . xaml, etc.
One of the solutions I found was to put the database inside the /Debug, however I believe it is not the appropriate way to do this.
From now on, thank you.
bully. send the paths. of the files I asked for. the complete path so that I know le forward to the best way
– Risk