简体   繁体   English

使用SQL Server 2008 for ASP.net 2.0成员资格提供程序

[英]Using SQL server 2008 for ASP.net 2.0 Membership provider

I tried to set-up the SQL tables for ASP .net 2.0 membership provider by clicking on ASP.net Configuration under Project. 我试图通过单击Project下的ASP.net配置为ASP .net 2.0成员资格提供程序设置SQL表。

I have completely uninstalled SQL 2005 Express and installed SQL 2008 Express instead. 我完全卸载了SQL 2005 Express并安装了SQL 2008 Express。

It seems like that it can not connect to the database. 好像它无法连接到数据库。

Does anybody know how to get this fixed so I can use 2008 instead ? 有没有人知道如何解决这个问题所以我可以用2008代替?

Try to configuring the database typing "aspnet_regsql" on the VS command prompt. 尝试在VS命令提示符下配置数据库“aspnet_regsql”。

Then setup the database and finally change de connection string on the web.config file. 然后设置数据库,最后更改web.config文件中的de连接字符串。

ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe) ASP.NET SQL Server注册工具(Aspnet_regsql.exe)

The connectionStringName used in the membership Tag should be changed to the present connection string where you have the membership tables created. 成员标记中使用的connectionStringName应更改为您创建成员资格表的当前连接字符串。

If the connectionStringName is not pointing to a valid connection String name in the connectionStrings tag, the membership tables can not be used by the application. 如果connectionStringName未指向connectionStrings标记中的有效连接String名称,则应用程序不能使用成员资格表。

What is your SQL 2008 installation instance called? 您调用的SQL 2008安装实例是什么? What does your connection string for the membership provider look like? 您的会员提供商的连接字符串是什么样的?

As far as I know, there is (or was) a glitch in the SQL Server 2008 Express installation that even if you chose to install as "default" instance, it would still make it a "named instance" called ".\\SQLExpress" instead. 据我所知,SQL Server 2008 Express安装中存在(或者是)一个小故障,即使您选择安装为“默认”实例,它仍然会使其成为名为“。\\ SQLExpress”的“命名实例”。代替。 Could that be the problem? 这可能是问题吗?

Marc

As Marc already has pointed out, it could be the problem with the instance name. 正如Marc已经指出的那样,它可能是实例名称的问题。 This is fixed in service pack 1 for SQL Server 2008 Express. 这在SQL Server 2008 Express的Service Pack 1中得到修复。 For more information and a workaround, see this Microsoft KB article . 有关详细信息和解决方法,请参阅此Microsoft知识库文章

SQL 2005 and 2008 are both configured in a fairly locked down state by default - and this means that SQL won't accept access the database other than through Shared Memory, even with Integrated Security. 默认情况下,SQL 2005和2008都配置为处于相当锁定状态 - 这意味着除了通过共享内存,SQL也不会接受访问数据库,即使使用集成安全性也是如此。

You need to enable TCP/IP or Named Pipes for the Client Protocols for the server (as this is how ASP.NET talks to SQL if you've not configured a DSN to use Shared Memory. 您需要为服务器的客户端协议启用TCP / IP或命名管道(因为如果您没有将DSN配置为使用共享内存,ASP.NET就是如何与SQL通信的。

I can't remember the exact steps in 2k8, as I've only had to do it once, but in 2k5 you had to open the SQL Server Configuration Manager, select SQL Native Client Configuration, Client Protocols, and enable TCP/IP and Named Pipes - it's a similar process for 2k8 as I recall. 我不记得2k8中的确切步骤,因为我只需要执行一次,但是在2k5中你必须打开SQL Server配置管理器,选择SQL Native Client配置,客户端协议,并启用TCP / IP和命名管道 - 我记得它是2k8的类似过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM