【问题标题】:Fail to open the database打开数据库失败
【发布时间】:2018-11-14 05:27:39
【问题描述】:

嗯,我知道这个问题在这个平台上被问过很多次。似乎没有什么对我有用。我看了这个Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASPNET'。我完全理解。

这种情况是我创建应用程序时默认创建的数据库。我选择个人身份验证。然后我使用 Entity Framework 6 扩展数据库。我想通过 Entity Framework 6 通过生成 .edmx 文件来创建 CRUD 操作。当我尝试将数据库附加到程序时发生错误。

我尝试使用 MSSQL Server 打开它以向用户分配权限。之后它会抱怨文件已损坏。如果有人会帮助我打开它或如何在其上生成 CRUD。我会很感激的。

【问题讨论】:

    标签: c# .net sql-server asp.net-mvc entity-framework-6


    【解决方案1】:

    您可以看到如下所示的连接字符串

    Data Source=.\SQLExpress;Initial Catalog=something;Integrated Security=True

    从您的连接字符串中删除Integrated Security=True,然后它将起作用

    更新

    建议保留Integrated Security。如果为 false,则在连接中指定用户 ID 和密码。如果为 true,则使用当前 Windows 帐户凭据进行身份验证。可能的状态为 truefalseyesnosspi Read More

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-07-11
      • 1970-01-01
      • 1970-01-01
      • 2015-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多