Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

Programming, error messages and sample code
I get the following error when I try to connect to my MSSQL database:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. 

This is because your connection string is wrong. Please double check your connection string and make sure it's same as the one displayed in your control panel -> database manager -> MSSQL manager-> Connection String.

You should also check to make sure you don't have the following attribute in your connection string:

 Integrated Security=SSPI;