I have a Windows service written in C # running on a Windows Server 2012 R2 machine that connects to a remote instance of SQL Server 2012 also on a Windows Server 2012 R2 server.
The SQL connection string is defined in App Config as follows:
<connectionStrings>
<add name="destinationConnectionString" providerName="System.Data.SqlClient"
connectionString="Server=10.42.42.10;Database=mydb;User ID=myuser;Password=mypass" />
</connectionStrings>
When the service starts, the output error log displays:
System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'MyUser'.
Error Number: 18456, Condition: 1, Class: 14
So, I check the SQL Server logs to find out more error information and find this
Login failed for user myuser Cause: Password does not match login "
Source: Message: Error: 18456, Severity: 14, State: 8.
, , . .
, SQL Server Management Studio SQL Server , " SQL Server".
, SSMS, Windows. , SSMS. Windows?
, - , ?
: , :
sqlcmd -S 10.42.42.10 -U myuser -P mypass -d mydb