App Config - The Login is from an untrusted domain

狂风中的少年 提交于 2020-01-05 04:30:30

问题


First, I try to connect to sql server of other computer(PC1-PC\Instance1) through ssms with Windows Authentication but got this error

Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

I resolve the error when I edit the password of sa to 1234 in PC1-PC\Instance1. Then connect in the ssms with SQL Server Authentication. And successfully connected.

The problem is in my Winforms app config, I set the connection to this:

<connectionStrings>
<add name="LibrarySystem.Properties.Settings.LibraryConnectionString" connectionString="Data Source=PC1-PC\Instance1;
     Initial Catalog=System1;Integrated Security=True;MultipleActiveResultSets=True;User id = sa;Password = 1234" providerName="System.Data.SqlClient"/>

But I got this error Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.


回答1:


<connectionStrings><add name="LibrarySystem.Properties.Settings.LibraryConnectionString" connectionString="Data Source=PC1-PC\Instance1;
 Initial Catalog=System1;MultipleActiveResultSets=True;User id = sa;Password = 1234" providerName="System.Data.SqlClient"/>


来源:https://stackoverflow.com/questions/18724747/app-config-the-login-is-from-an-untrusted-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!