问题
I am using the ASP.NET 2.0 and I am using local server --> SQL Server 2005 Development Edition. WHen I go into VIsual Studio 2.0 Professional and go to menu item WEBSITE --> ASP.NET CONFIGURATION, the ASP.NET Web Site Administration Tool shows. When I click on the Security link, after about 30 seconds an error pops saying Unable to connect to SQL Server database. I can connect to the SQL database via Server Explorer in VS 2005 and also via Grid Control etc but I keep getting the error when I try to connect via ASP.NET CONFIGURATION.
I will greatly appreciate anyone help.
THanks!
回答1:
Not sure if that's the problem, but the ASP.NET Configuration used to require the ASP.NET tables. You could create those with:
aspnet_regsql.exe -E -S localhost -A all
The aspnet_regsql executable can be found in:
C:\%windir%\Microsoft.NET\Framework\<versionNumber>\aspnet_regsql.exe
See also this article on MSDN
回答2:
This answer and other research helped me get this working. I have summarized the steps in detail here http://www.yart.com.au/Resources/Programming/ASP-NET-Security-Doesnt-Work.aspx
回答3:
I think it has to do with the connection string in a development environment and a production environment. WSAT can only be accessed locally [for a production environment] so, u have to go to ur webconfig file in Visual Studio and replace the development connection string with a production connection string. After test, reverse back to develpment connection string. For more details see: https://docs.microsoft.com/en-us/aspnet/web-forms/overview/older-versions-getting-started/deploying-web-site-projects/users-and-roles-on-the-production-website-cs
来源:https://stackoverflow.com/questions/1719110/web-site-administration-tool-unable-to-connect-to-sql-server-database-using-sq