tags:

views:

64

answers:

3

I'm working on an Asp.Net Application in Windows XP Professional with IIS 5, VS 2008 and MS Sql Server 2008. Normal Asp.Net program and html page can be viewed correctly in IIS, however, if there is a successful database connection in the Asp.Net program(otherwise it will show a exception page), the IIS will ask for username and password and then throws:

You are not authorized to view this page ... HTTP 401.2 - Unauthorized: Logon failed due to server configuration

Any one can help?

Thanks

A: 

First thing to always check is that you have configured SQL Server to allow remote connections.

How to configure SQL Server 2005 to allow remote connections

For generic SQL Server Connectivity Troubleshooting consult the following Blog Post

John Sansom
thanks for your reply, I will check that.
+1  A: 

IIS requesting user name and password - do you have windows authentication enabled, or basic, or anonymous? IIS requesting a user name/password isn't database related necessarily...

Brian
A: 

Finally I find out it's not the Asp.Net or SQL Server problem, it's because the Asp.Net program uses URL stored in database and redirect the user to the web root, then when user navigate to the web root directory, IIS automatically uses the iisstart.asp page as an index page, and that page caused the authentication dialog.