[英]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.我使用的是 ASP.NET 2.0,我使用的是本地服务器 --> SQL Server 2005 开发版。 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.当我进入 VIsual Studio 2.0 Professional 并转到菜单项 WEBSITE --> ASP.NET CONFIGURATION 时,会显示 ASP.NET 网站管理工具。 When I click on the Security link, after about 30 seconds an error pops saying Unable to connect to SQL Server database.当我单击安全链接时,大约 30 秒后会弹出错误消息,提示无法连接到 SQL Server 数据库。 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.我可以通过 VS 2005 中的服务器资源管理器以及网格控制等连接到 SQL 数据库,但是当我尝试通过 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.不确定这是否是问题所在,但 ASP.NET 配置过去需要 ASP.NET 表。 You could create those with:您可以使用以下方法创建它们:
aspnet_regsql.exe -E -S localhost -A all
The aspnet_regsql executable can be found in:可以在以下位置找到 aspnet_regsql 可执行文件:
C:\%windir%\Microsoft.NET\Framework\<versionNumber>\aspnet_regsql.exe
See also this article on MSDN另请参阅 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我在这里详细总结了步骤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. WSAT 只能在本地访问[对于生产环境],因此,您必须在 Visual Studio 中访问您的 webconfig 文件,并将开发连接字符串替换为生产连接字符串。 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 : //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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.