Reputation: 2124
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?
Upvotes: 3
Views: 745
Reputation: 3485
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
Upvotes: 0
Reputation: 8595
Maybe looking at the connection string in the debugger will help you find it. Take a look at the Database.Connection.ConnectionString property of the Context you new up.
EF generates a different default connection string depending on the context it's ran in, so I can't tell you for sure where it'll be.
The relevant source code for generating the localdb connection string is here
Upvotes: 1