我一直在尝试开发一个 ASP.NET 项目,其中包括用户和角色管理。我尝试使用的第一件事是 ASP.NET 配置,它将为我打开一个网站,我可以在其中添加用户和角色。我得到这个网站。接下来,我单击“安全”选项卡。这应该让我做进一步的配置。但是,当我单击“安全”选项卡时,我会看到一个屏幕,显示“无法连接到 SQL SERVER 数据库”,下面有一个选项显示“选择数据源”。当我单击该按钮时,它会进入“提供商”选项卡。在这里,我可以看到一个名为“AspNetSqlProvider”的选项。当我测试该提供程序时,我收到以下消息:
提供商管理无法建立与数据库的连接。
如果您尚未创建 SQL Server 数据库,请退出网站
管理工具,使用 aspnet_regsql 命令行实用程序
创建并配置数据库,然后返回到这个工具进行设置
提供商。
我不明白这个问题,因为我一直在我的应用程序中使用 SQL SERVER 并且它运行良好。
请注意,我的计算机上尚未安装 sql server Express 版本。相反,我安装了完整版本的 sql server 2008。
此外,当我尝试使用 Windows 身份验证从 sql server management studio 建立连接时,我收到一条消息:
无法连接到 SUDHIR-PC A 网络相关或特定于实例
建立与 SQL Server 的连接时发生错误。这
找不到服务器或无法访问服务器。验证实例
名称正确并且 SQL Server 配置为允许远程
连接。 (提供程序:命名管道提供程序,错误:40 - 无法
打开与 SQL Server 的连接)(.Net SqlClient 数据提供程序)
但是,我在我的 asp.net 项目中使用了相同的连接来建立数据库连接并使用一直工作正常的数据库。
请指导我解决这个问题。
I've been trying to work on an ASP.NET project which includes user and role management. First thing that I tried to use is the ASP.NET configuration which will open up a website for me where I can add users and roles. I get this website. The next thing is that I click on the "security" tab. That should let me do further configuration. But, when I click on the security tab I get a screen saying "Unable to connect to SQL SERVER DATABASE"
with an option below saying "choose data source"
. When I click on that button it goes into the "providers" tab. Here, I can see one option called "AspNetSqlProvider". When I test this provider I get this message :
Provider Management Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site
Administration tool, use the aspnet_regsql command-line utility to
create and configure the database, and then return to this tool to set
the provider.
I don't understand the problem as I have been using SQL SERVER in my applications and it has been working fine.
Please note that I have not installed sql server express edition on my computer. Instead, I have installed the complete version of sql server 2008.
Also, when I try to establish a connection from sql server management studio with windows authentication, I get a message saying :
Cannot connect to SUDHIR-PC A network-related or instance-specific
error occurred while establishing a connection to SQL Server. The
server was not found or was not accessible. Verify that the instance
name is correct and that SQL Server is configured to allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server) (.Net SqlClient Data Provider)
But, I've used the same connection in my asp.net project to establish database connection and use the database which has been working fine.
Please guide me to solve this problem.
发布评论
评论(2)
对于大多数 SQL2008 版本,命名管道连接默认被禁用,我不确定当你说“完整”时你指的是哪个版本。企业?标准?开发商?这是默认值的链接 。
您需要启用命名管道才能通过 SSMS 连接
这里是一个全面的 链接,其中介绍了启用连接和可能的 Windows 防火墙注意事项。
Named Pipe connections are disabled by default for most SQL2008 versions, I'm not sure which version you mean when you say "complete". Enterprise? Standard? Developer? Here is a link to the defaults.
You will need to enable Named Pipes to connect via SSMS
Here is a comprehensive link that covers enabling the connection and possible Windows Firewall considerations.
我相信您需要安装 ASP.NET 会员数据库。请按照本文中的说明操作:
http://weblogs.asp.net/sukumarraju/archive/2009/10/02/installing-asp-net-membership-services-database-in-sql-server-expreess.aspx
I believe that you need to install the ASP.NET Membership database. Follow the instructions in this article:
http://weblogs.asp.net/sukumarraju/archive/2009/10/02/installing-asp-net-membership-services-database-in-sql-server-expreess.aspx