I need help solving this problem. I created the application installer using MS Visual Studio Installer Projects and ran it on another device. There were no versions of LocalDB that installed on my computer (2016 and 2017) in the prerequisites, so I had to download the SQL Server 2017 LocalDB on another computer manually. After that, when I started the program I received the following error.
Database files were automatically placed during installation in the folder Documents
I changed the connection string as follows:
string dbPathMyDoc = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string dbPath = Path.Combine(dbPathMyDoc, "myprojectAppData");
AppDomain.CurrentDomain.SetData("DataDirectory", dbPath);
So it seems to me that the problem is not the connection string, but then what?