2011-04-04 54 views
3

使用网站管理工具时,它总会给数据库提供错误。您在ASP.NET网站上选定的数据存储的问题管理工具

<membership> 
    <providers> 
    <remove name="AspNetSqlMembershipProvider"/> 
    <add name="FTESqlMembershipProvider" 
     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     connectionStringName="FTEDashBoard.ConnectionString" 
     enablePasswordRetrieval="false" 
     enablePasswordReset="true" 
     requiresQuestionAndAnswer="true" 
     applicationName="/" requiresUniqueEmail="false" 
     passwordFormat="Hashed" maxInvalidPasswordAttempts="5" 
     minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" 
     passwordAttemptWindow="10" passwordStrengthRegularExpression=""/> 
    </providers>   
</membership> 

<roleManager> 
    <providers> 
    <remove name="AspNetSqlRoleProvider"/> 
     <add name="FTESqlRoleProvider" connectionStringName="FTEDashBoard.ConnectionString" 
      applicationName="/" 
      type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>   
    </providers> 
</roleManager> 

这是给我这个错误:

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Object reference not set to an instance of an object. and when i want to choose datatsource is giving me The following message may help in diagnosing the problem: Object reference not set to an instance of an object. at ASP.providers_chooseprovidermanagement_aspx.Page_Load() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\Providers\chooseProviderManagement.aspx:line 13 at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint

IAM真的不usre为什么工具它不能接取数据库..我在web.config中的ConnectionString是

<connectionStrings> 
    <add name="FTEDashBoard.ConnectionString" connectionString="Data Source=logsuatsql01;Initial Catalog=CMNBS;Persist Security Info=True;User ID=FTEDashboard;[email protected]#;Max Pool Size=500;AttachDBFilename=|DataDirectory|aspnetdb.mdf;Connect Timeout=600"/>  
</connectionStrings> 
+0

当iam选择它正在提供提供商管理 无法建立到数据库的连接。 如果尚未创建SQL Server数据库,请退出Web站点管理工具,使用aspnet_regsql命令行实用程序创建和配置数据库,然后返回到此工具以设置提供程序。 – deepti 2011-04-04 17:11:14

+0

数据库是否存在?你有访问它吗?运行该网站的用户环境是否可以访问它? – David 2011-04-04 17:14:50

+0

嗨大卫..是数据库存在.. ans所有aspnet_userrs表存在于不同的数据库,所以我改变我的conenction字符串 deepti 2011-04-04 17:39:11

回答

3

正如错误中提到的,你可能想启用角色管理器,如:

<roleManager enabled="true"> 

编辑1:

连接字符串中存在缺陷。删除这个:AttachDBFilename = | DataDirectory | aspnetdb.mdf;你在你的DB - CMNBS中有你的aspnet会员表吗?

+0

没有它不解决问题 – deepti 2011-04-04 17:40:36

+0

noo在application_configuration thatsw hy我改变了连接..为什么AttachDBFilename = | DataDirectory | aspnetdb.mdf这必须删除.. – deepti 2011-04-04 18:12:32

+0

我的坏...因为你有你在application_configuration数据库中的成员表,不需要使用AttachDBFile ....语法。确保您的会员资格和角色正在使用正确的连接字符串。 – gbs 2011-04-04 18:18:45

6

我也遇到了这个问题。我发现我所要做的就是重建我的解决方案。

希望有帮助!

2

此问题主要在解决方案清理时生成! 因此,请尝试重新构建整个解决方案,并解决问题。