问题
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