c# - Entity Framework Code First 在服务器资源管理器中找不到数据库

标签 c# database unity-container

因此,我按照 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/

相关文章:

c# - 用于 Mono 的 Winforms 或 XWT GUI 设计器?

c# - SQL 语法错误;请查看与您的 MySQL 服务器对应的手册

c# - 如何在 c#.net 中使用单个变量而不是使用多个变量

c# - Unity 解决循环依赖

c# - 在现有注册上添加拦截

asp.net-mvc - 特定可移植区域的ControllerFactory

c# - 如何在 xamarin android 中扩展应用程序类

sql - 特定数据的不良 desc 排序性能 - Postgresql 10.3

ruby-on-rails - 从 ActiveRecord 对象继承

sql - 在 phpMyAdmin 中实现下拉菜单