因此,我按照 Entity Framework Code First 的介绍创建了一个新数据库 (https://msdn.microsoft.com/en-us/data/jj193542),并且我完全遵循了该示例。现在我想将它添加到我在 Visual Studio 2013 中的服务器资源管理器中。
尝试了 LocalDb ((localdb)\v11.0) 或 SQL Express (.\SQLEXPRESS) 但数据库没有显示,我知道它在工作,因为我现在已经测试了它多次并且它一直在追加和获取来自数据库的数据,那么它会存放在哪里?
除了默认的 Visual Studio 2013,我还有一个 SQL Server 设置。谢谢
配置
<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>
最佳答案
查看您的配置(在聊天期间提供),我可以看到您的 EF 正在使用 localdb 和 MSSQLLocalDB
实例。
尝试:
(localdb)\MSSQLLocalDB
关于c# - Entity Framework Code First 在服务器资源管理器中找不到数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30655565/