I had created a Application Winform and use connection with local file put same path file.exe. User connection string:
Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='DataManagement.mdf';Integrated Security=True;Connect Timeout=30 => This is working a many days ago and I had to release.
Now, I open source with Visual Studio with same device which Build source before, and add some functions, not change any about of connection string. Then, I run and a messagebox appear:
Cannot open database "...\BIN\DEBUG\Database.MDF" requested by the login. The login failed. Login failed for user 'ASKNKO\ASKNKO'.
-I try to run file.exe which release before, It's still working.
-I copy two file .mdl and .ldf from release to path debug and run file.exe => It's worked. But this database have not update some tables like new Database in debug has error
-I use SSMS to Attach file mdf which work fine to add tables, then I Detach this database from SSMS tool to close connection. And I run in visual, the message error appear again like above
-Why open file in SSMS tool with Window Authenticate is OK, but not in Visual Studio ?
How can I fix this ?
Thanks.
