SQL Connection problems...

You need to decide if you want to use a trusted connection or not. You've sent a mixed signal by specifying the USerID and a password, but then also set trusted connection = True. The trusted connection trumps all other user info. When you do that it uses the Windows login for current user context, in this case the ASPNET user that ASP.NET runs under.

Solution:
1) Dump the trusted connection by setting it to false.
2) Remove the specified user & password from the connection string, then make sure the ASPNET user context has adequate permissions to the SQL Server database.

-tg
 
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)
 
Back
Top