Login failed for user 'username'./test.asp, line 6"
So, the solution to this error is very simple:
1-Open the SQL Server 2008 R2.
2-In SQL Server Management Studio object explorer, right-click the server, and then click properties.
3-Server properties panel will appear on your screen,on the left panel click on the Security page, under Server authentication, select the SQL Server and Windows authentication mode, and then click OK.
4-In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
5-In Object Explorer, right-click your server, and then click Restart. If SQL Server Agent is running, it must also be restarted.
6-Now to enable the 'username' Login, go to the Object Explorer, expand Security, expand Logins, right-click username, and then click Properties. On the General page, you might have to create and confirm a password for the login.On the Status page, in the Login section, click Enabled, and then click OK.
7-After that just refresh the server.