>Have you encountered this problem when trying to connect to SQL Server 2000 with .NET?
>Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
>
>Exception Details: System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
>
>Source Error:
>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
>
>
>
>
>Not sure why this keeps happening... Anyone have any ideas.?
Alvin;
I ran into this problem as an anonymous user. A different approach to security may require a different approach.
ASP NET Login Issues for anonymous users
Problem:
Error message – Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’.
Reason:
IIS not set correctly
Resolution:
1. Open IIS
2. Go to Default Web Site
3. Right Click on Web Project of interest
4. Select Properties
5. Select Directory Security
6. Go to “Anonymous access and authentication control”
7. Select “Edit”
8. Uncheck “Anonymous access”
9. Select OK
10. Select Apply
11. Select OK
Problem:
Error message – Login failed for user ‘(null)’. Reason”: Not associated with a trusted SQL Server connection.
Reason:
IIS and/or Web.config may not be set correctly
Resolution:
See above to set IIS.
In the Web.config file add the following line after the <system.web> tag and before the </system.web> end tag
<identity impersonate = "true"/>
Tom