I have a database that sits on my local PC. I want to create a .mdf file based on this database. I created an empty .mdf file in Visual Studio. How to connect to SQL Server Management Studio and run queries against it?
But I want to create a .mdf file .mdf on an existing database, which will save me time on restoring the entire database in Visual Studio, and will also have all the data in the tables.
I check this link. this does not help me solve my question.
Also tried to copy the .mdf file from C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA to my project in the App_Data folder, but it ran an error App_Data cannot complete because file is used by SQL Server
Thanks.
source share