在SQL Server Management Studio中找不到数据库

主动92

我目前正在关注Entity Framework Tutorial该代码设法成功运行。我也能够检索数据。

但是,我在SQL Server Management Studio中找不到我的数据库。

这是我的连接字符串

<connectionStrings>
    <add name="MyContextDB" 
         connectionString="data source=.\SQLEXPRESS;Initial Catalog=EFMyContextDB;integrated security=True;user instance=True;multipleactiveresultsets=True;" 
         providerName="System.Data.SqlClient" />
</connectionStrings>

这是我的DbContext

public class MyContext : DbContext
{
    public MyContext() : base("name = MyContextDB") { }
    public virtual DbSet<Course> Courses { get; set; }
    public virtual DbSet<Enrollment> Enrollments { get; set; }
    public virtual DbSet<Student> Students { get; set; }
}
不被爱

如果使用user instance=True;数据库,则该数据库将仅存在于您当前登录的用户上下文中。我不太确定这会对SSMS产生什么影响,但是可能您还需要以该用户身份登录到SSMS

更多信息在这里:

https://technet.microsoft.com/zh-CN/library/ms143684(v=sql.105).aspx

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

SQL Server Management Studio无法启动-找不到类型库

在SQL Server Management Studio中看不到EF数据库

在 Microsoft SQL Server Management Studio 19 中找不到序列

SQL Server查询找不到数据库中的行

SQL Server Management Studio忽略默认数据库

SQL Server Management Studio 数据库图标

SQL Server 2008 R2无法连接到Management Studio中的本地数据库

意外删除mdf文件后无法分离SQL Server Management Studio中的数据库

如何在SQL Server Management Studio中连接到本地数据库?

是否可以从Microsoft SQL Server Management Studio中打开SQLite数据库?

无法在SQL Server Management Studio中编辑Azure数据库的行

如何在SQL Server Management Studio中删除数据库的内容?

如何在SQL Server Management Studio中关闭与本地数据库的所有连接?

VB.NET在VS2013或SQL Server Management Studio中创建本地数据库

如何在Microsoft SQL Server Management Studio中更新数据库图

如何确保SQL Server Management Studio中数据库副本的独立性?

无法连接到我的SQL Server Management Studio中的arvixe数据库

在SQL Server Management Studio中打开后,VS 2012数据库不再工作

如何删除SQL Server数据库,使其不出现在Management Studio中

如何在不使用MS SQL Server Management Studio的情况下在SQL Server中更改默认数据库?

无法访问在 SQL Server 2014 Management Studio 中通过 Plesk 创建的 SQL Server 数据库

使用SQL Server数据库是否需要SQL Server Management Studio?

如何通过SQL Server Management Studio Studio对您的数据库运行SQL语句?

使用SQL Server Server Management Studio导入/导出数据库

SQL Server:“找不到数据库引擎启动句柄”

SQL Server Management Studio中需要哪些数据库角色来添加和执行存储过程

SQL Server Management Studio默认数据库的桌面快捷方式

如何防止用户在SQL Server Management Studio中看到不属于他的数据库?

SQL Server Management Studio 2012 无法附加主数据库?