Click here to Skip to main content
14,869,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using MS SQL Server 2008 R2

I generated a script for my ASP.NET Database, now when I try to use the database it gives an error:
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.

What options do I really have to solve this problem?

Do I need to run aspnet_regsql.exe or is there a way to get around this error besides having to go with this option as the error suggests?

My web.config file looks like this:
HTML
<compilation debug="true" targetframework="4.0">
  <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </assemblies>
</compilation>

<membership defaultprovider="SqlProvider">
  <providers>
    <clear />
    <add name="SqlProvider">
         type="System.Web.Security.SqlMembershipProvider"
         connectionStringName="CPMS_DB"
         enablePasswordRetrieval="false"
         enablePasswordReset="true"
         requiresQuestionAndAnswer="true"
         requiresUniqueEmail="false"
         maxInvalidPasswordAttempts="3"
         minRequiredPasswordLength="6"
         minRequiredNonalphanumericCharacters="0"
         passwordAttemptWindow="3"
         applicationName="/"/>
  </add></providers>
</membership>
<profile>
  <providers>
    <clear />
    <add name="AspNetSqlProfileProvider">
         type="System.Web.Profile.SqlProfileProvider"
         connectionStringName="ApplicationServices"
         applicationName="/"/>
  </add></providers>
</profile>
<rolemanager enabled="true">
  <providers>
    <clear />
    <add connectionstringname="ApplicationServices">
         applicationName="/"
      name="AspNetSqlRoleProvider"
         type="System.Web.Security.SqlRoleProvider" />
    <add applicationname="/">
         name="AspNetWindowsTokenRoleProvider"
      type="System.Web.Security.WindowsTokenRoleProvider" />
  </add></add></providers>
</rolemanager>

Please help.... Thank you
Posted
Updated 12-Oct-13 8:28am
v3

I copied the values from the my old DB (the 1 I had generated the script for) from table "aspnet_Applications" and pasted them on the new script generated database, the the application ID into all the other related tables that need the applicationId.
Also did the same with table "aspnet_SchemaVersions"

Now it works perfectly
Happy coding.........
   
v2
You can check the below link for a solution . Please try it though it sounds sily :)

http://stackoverflow.com/questions/3292794/the-system-web-security-sqlmembershipprovider-requires-a-database-schema-compa[^]

Hope this helps...
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900