Entity Framework Code First Cannot Find Database in Server Explorer

So, after this introduction to the Code Entity Framework, I first created a new database ( https://msdn.microsoft.com/en-us/data/jj193542 ), and I completely completed this example, Now I want to add it to my server Explorer in Visual Studio 2013.

I tried both LocalDb ((localdb) \ v11.0) and SQL Express (. \ SQLEXPRESS), but the database does not appear, I know that it works, because I tested it several times, and it continues to add and extract data from the database, so where will he live?

Besides the standard Visual Studio 2013, I have a SQL Server setup. Thanks

Config

<configuration> 
  <configSections> 
    <!-- For more information on Entity Framework configuration, visit go.microsoft.com/fwlink/… --> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
  </configSections> 
  <startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> 
  </startup> 
  <entityFramework> 
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> 
      <parameters> 
        <parameter value="mssqllocaldb" /> 
      </parameters> 
    </defaultConnectionFactory> 
    <providers> 
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> 
    </providers> 
  </entityFramework> 
</configuration>
+4
source share
4

( ), , EF localdb MSSQLLocalDB. :

(localdb)\MSSQLLocalDB
+11

, , :

  • , context dbcontext , .
  • , DatabaseConnection - .
+3

Microsoft VS2015, , _ : (localdb)\MSSQLLocalDB : CodeFirstNewDatabaseSample.Program + BloggingContext enter image description here

0

Visual Studio SQL Server. , :

  • SQL Server Management Studio.
  • ""
  • , (, \SQLEXPRESS)
  • Visual Studio: SQL Server
  • .
  • Select a database. In the Properties window, find the Data File property. This is the path to the database file.
0
source

All Articles