The problem here is that you are using windows authentication. When you run a windows application It is being runned as the currently logged on user, you, I suppose you are running with administrator privileges, because this group has got default access at sql server through windows authentication. Now when you use asp.net the website does not run as the currently logged on user but as you see under the ASP.NET user account. This account does not have administrator privileges, so it can not access your sql server through windows authentication without some modifications.
Possible solutions:
- Add the ASP.NET user account to the logins of your database
- Use sql server authentication instead (userid and pwd parameters)
- Use Impersonation in Asp.Net
- If running IIS 6.0 change the user account of the application pool that is running your website to a user that has the correct rights in sql server (DO NOT run the application pool with admin privileges, because this isn't secure)