I am using VS2012 and I have a database created:
(localdb)\v11.0 (SQL Server 11.0.2100 - T61\Alan)
How can I find out the physical location of this database. How can I back this up? Can I just make a copy of the files, move these to another location and start the database again.
Here is my connection string:
<add name="DB1Context" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=DB1;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
The system database files for the database are stored in the local AppData path, which is normally hidden. For example, C:\Users\<user>\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\LocalDBApp1\ .
Right-click the SQL Server or SQL Browser service and select Properties to open the SQL Server (Instance) or Browser Properties window. 4. The path listed under Path to Executable is the path to the SQL Server or Browser service.
By default, LocalDB database creates “*.mdf” files in the C:/Users/"username" directory.
Link ref: https://docs.asp.net/en/latest/tutorials/first-mvc-app/working-with-sql.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With