Search code examples
entity-frameworkef-code-firstcode-firstlocaldb

Where did Entity Framework 6.1 put my database?


I am using EF 6.1 and VS 2012 to create a Code First data model basically following the Code First module in Julie Lehrman's EF5 Pluralsight video. It appears to be working just as advertised except I can't find the data file anywhere. I can access it in code, but by no other method.

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


Solution

  • LocalDb databases have a default location (C:\Users\xxxx\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0), and you can open MSSQL Management Studio against them with the 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