Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using a trusted connection to login to a SQL Server database. The website directory security is set with Basic Authentication enabled and Anonymous disabled. We have always used this same configuration with ASP websites with no problem, but with .NET we get "Login Failed For User ..." Has anyone else experienced this problem and does anyone have any ideas how to fix it?
Posted

In your web.config, if you have a connection string along the lines of

Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

Then whenever your website attempts to open a connection using this connection string, it will make it under the crendetials of the ASPNET worker process.

http://weblogs.asp.net/achang/archive/2004/04/15/113866.aspx[^]

http://idunno.org/articles/276.aspx[^]

For Windows 2000 Server or XP Pro machines, you just need to make sure the local "ASPNET" account (under which ASP.NET application runs) has appropriate access to the database that your application will be using.


You need to make sure that the worker process has access to your database, the articles linked should describe the problem and possible solutions
 
Share this answer
 
Comments
Manfred Rudolf Bihy 4-Jan-11 11:39am    
Good one! 5+
Here's[^] a good article on that may help you out.
 
Share this answer
 
Comments
Henry Minute 4-Jan-11 9:47am    
Good link!
Sandeep Mewara 4-Jan-11 9:58am    
Comment from OP:
I've seen this article before. It did not help.
The problems discussed in this article apply to both ASP and .NET. We only have the problem with .NET. In ASP it works fine.
Manfred Rudolf Bihy 4-Jan-11 11:39am    
Good call!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900