Database Schema compatibility error in FBA

This is an interesting issue I came across recently and it was nice to know things that I thought would be hardly a matter to be considered.

Well, the gist of the issue is very simple.  When using default providers (AspNetSqlMembershipProvider & AspNetSqlRoleProvider) to try to setup FBA, at the point of user and role addition, we see the following error:image

Not to forget, Visual Studio 2005 is the tool used for this purpose and before you jump to areas to probe further, we had perfect web.config file and the ASP.NET Web Application Administration web site opens up fine.  The above error is seen once we click “Security” tab.

Apparently, it was a production environment and customer had used the script database and object feature provided by SQL Server 2005 to re-create their test database on production.  It looks like something gets messed up when taking the scripting approach, something weird that ASP.NET configuration utility is not able to digest and throws this schema error.

Well, how to fix it? – There are two ways:

1. Use the aspnet_regsql.exe utility and create a new database on the target server.

2. Use DB backup/restore option OR “Copy database…” feature offered by SQL Server 2005 to replicate database structure and content.