首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >“System.Web.Security.SqlMembershipProvider”需要与架构版本“%1”兼容的数据库架构

“System.Web.Security.SqlMembershipProvider”需要与架构版本“%1”兼容的数据库架构
EN

Stack Overflow用户
提问于 2010-07-21 01:46:32
回答 10查看 45.3K关注 0票数 61

我有一个SQL Server2008DB,其中有许多用数据填充的表,我使用SQL Server Management Studio生成SQL转储,方法是:使用脚本向导: Tasks -> generate Scripts -> Script All objects in the selected database,并选择对数据执行脚本的选项。我确保将"Script for Server Version“的值更改为"SQL Server2008”。然后,我创建了一个新数据库,并在新数据库上运行SQL转储,以生成与旧数据库完全相同的副本。然后,我将权限分配给新数据库的默认用户。然后,我更改了ASP.NET应用程序上的连接字符串,以使用新的DB。但当我运行它时,它抛出了以下异常-

            Server Error in '/myapp' Application.
            The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.
            Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

            Exception Details: System.Configuration.Provider.ProviderException: The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.

            Source Error:

            An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

            Stack Trace:

            [ProviderException: The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.]
               System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +1977772
               System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection) +89
               System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +815
               System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
               System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
               System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78
               System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
               System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119
               System.Web.UI.WebControls.Login.AttemptLogin() +115
               System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
               System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
               System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
               System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
               System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
               System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
               System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
               System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3292794

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档