Nếu bạn gặp lỗi Login failed for user 'IIS APPPOOL\ASP.NET v4.0', khi dùng IIS 7 trở lên ( dùng localhost ) thì thử cách sau để fix lỗi đó khi chạy !
You can change the ApplicationPoolIdentity from IIS7 -> Application Pools -> Advanced Settings. 
Under ApplicationPoolIdentity you will find local system. This will make your application run under NT AUTHORITY\SYSTEM
, which is an existing login for the database by default.