0

We receive an error Login failed for user 'x' sometimes from our application. We are 100 % sure the login is working because we checked it by manual login from SSMS as well as from the application. The error happens sometimes only. How can we find the exact reason for the failure? Why does it fail only sometimes? Below is the whole stack trace:

Exception Type : System.Data.SqlClient.SqlException
Message : Login failed for user 'x'.
Source : .Net SqlClient Data Provider

4
  • We have checked SQL Server logs, but did not find failed login attempt there.
    – Paresh
    Dec 30, 2014 at 13:45
  • 1
    See Troubleshooting Error 18456 especially state 16.
    – Paul White
    Dec 30, 2014 at 13:51
  • If you can't find the failed login attempt in the SQL Server log, then I suspect that when it fails you are trying to connect to the wrong server (or you're simply not looking at the right instance). How is your connection string initialized? Have you done any debugging in the application to reproduce the problem? Dec 30, 2014 at 14:40
  • It does not reproduce every time. only sometime we received a such error from email which i mentioned
    – Paresh
    Dec 31, 2014 at 7:16

0

Browse other questions tagged or ask your own question.