3

I am trying to follow the video tutorial on http://msdn.microsoft.com/en-us/data/jj193542 using Visual Studio 2012 Express for Desktop.

I created POCO's, and a DbContext, ran some sample queries and it worked. But I did not provide any connection string. So where is the database? (sdf or mdf file maybe?)

During the tutorial the guy uses SQL Server Object Explorer to view the database, but I couldn't find that view in VS Express.

For reference, here is the default App.config that gets generated.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </entityFramework>
</configuration>

2 Answers 2

8

"If SQL Express is installed (included in Visual Studio 2010) then the database is created on your local SQL Express instance (.\SQLEXPRESS). If SQL Express is not installed then Code First will try and use LocalDb ((localdb)\v11.0) - LocalDb is included with Visual Studio 2012"

For more information : http://msdn.microsoft.com/en-us/data/jj591621.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

For Visual Studio 2015 it seems to default to (LocalDb)\mssqllocaldb.
0

@Default is correct, the default SQL server is (LocalDb)\mssqllocaldb in VS 2015 and 2017.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.