【问题标题】:Local SQL Server 2005 database connection throwing exception本地 SQL Server 2005 数据库连接引发异常
【发布时间】:2014-07-05 04:45:33
【问题描述】:

我在 SQL Server 2005 的机器中有一个本地数据库。当我尝试使用 system 用户连接到数据库时,我遇到了一个异常:

System.Data.SqlClient.SqlException (0x80131904):` 用户“NT AUTHORITY\SYSTEM”登录失败。

你能帮忙吗?

static void Main(string[] args)
{
     string connectionString = "server = (local); database = XXXXX;trusted_connection=yes";

     using (SqlConnection connection = new SqlConnection())
     {
          connection.ConnectionString = connectionString;
          connection.Open();
     }
}

【问题讨论】:

    标签: c# sql-server-2005


    【解决方案1】:
    1. 在您的数据库上授予登录“NT AUTHORITY\SYSTEM”的访问权限,转到 sql mngt studio >Logins,右键单击“NT AUTHORITY\SYSTEM”,选择属性。
    2. 将 Integrated Security=SSPI 放入连接字符串中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多