Sunday, February 12, 2012

Connect to sql server from asp.net web app

Hi,
I have a website on a dedicated web server that can't communicate with a sql server 2000 database sitting behind a firewall. My website is written in asp.net 2 and c# 2 and port 1433 has been opened through the firewall to allow access. On the db server is an admin database set up to use asp.net authentication. I am running Visual Web Dev 2005 Express on the web server to test the application and initially I want to connect to that db and set up my app and asp 'admin' users. For that I would normally use the 'Website/ ASP.NET Configuration' menu option within the IDE. At the moment I just get a connection error:

Server Error in '/asp.netwebadminfiles' Application.

------------------------

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.

------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Server Error in '/asp.netwebadminfiles' Application.

------------------------

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.

------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Now which server is the problem on - the web server?? What do I need to do to connect with this db? Help! Thanks in advance.

Chris

Look at the IIS logs to see what request generated the 401.2 result code.

Jeff

No comments:

Post a Comment