Web Site Administration Tool: Unable to connect to SQL Server database (using SQL Server Development Edition)
开发者_开发知识库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!
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
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
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://learn.microsoft.com/en-us/aspnet/web-forms/overview/older-versions-getting-started/deploying-web-site-projects/users-and-roles-on-the-production-website-cs
精彩评论