Where did Entity Framework 6.1 put my database?

I'm using EF 6.1 and VS 2012 to create a First Code data model, basically following the Code First module in the Julie Lehrman EF5 Pluralsight video. It seems to work the same as advertised, except that I cannot find the data file anywhere. I can access it in code, but no other method.

I am using the default LocalDb factory connection. The database does not appear in SQL Server Object Explorer under (localdb) v / 11.0. There is no mdf file anywhere in the solution or in my user folder. Where did Entity Framework put data?

+3


source to share


2 answers


Local Databases LocalDb have a default location (C: \ Users \ xxxx \ AppData \ Local \ Microsoft \ Local Directory SQL Server \ Instance \ v11.0) and you can open MSSQL Management Studio against them with a connection string "(localdb ) \ v11.0 "and Windows Authentication.



See http://blogs.msdn.com/b/sqlexpress/archive/2011/10/28/localdb-where-is-my-database.aspx

0


source


Perhaps searching for the connection string in the debugger will help you find it. Take a look at the Database.Connection.ConnectionString property of the context you are new to.

EF generates a different default connection string depending on the context it was running in, so I can't tell you exactly where it will be.



Relevant source code for generating localdb connection string here

+1


source







All Articles