I am trying to attach a *.mdf
file to a SQL Server Express version. But I still have a problem with attach and then I removed a database and create a new but same problem when I use Update-Database
in Package Manager Console.
My default connection string is:
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;AttachDBFilename=App_Data\\TVK3.mdf;Database=TVK3;Trusted_Connection=true;MultipleActiveResultSets=true;"
I get this error:
Cannot attach the file 'App_Data\TVK3.mdf' as database 'TVK3'.
I searching on google and trying some advice but nothing helped to me. Thank you for any advice.
As davidbaumann said below my posts in comments. When i used absolute filename everythings working good. Thank you.