Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 28, 2010 06:08 PM by timmykhan
Apr 25, 2006 03:24 PM|LINK
I am relatively new to ASP.Net. 2.0. I am working on a potential website and would like to take advantage of the ASP.Net 2.0 Login Membership tools.
The controls work fine on my local PC but give me an error when I move them to a remote website.
My setup is as follows:
Here’s what I did on my local box:
I created a database for my application using SQLExpress.
I then used the ‘asppnet_regsql.exe’ tool to add the appropriate tables, views, stored procs required for the Membership tools.
I then built some test pages for with the CreateNewUserWizard and the Login Control.
Everything works fine when testing them locally.
To test this on a remote server, I generated scripts for all the tables, views, and stored procedures and use those scripts to recreate them on a remote SQL 2005 server located at a web hosting company.
(They don’t allow remote connections so I can’t run the aspnet_regsql.exe tool on their server).
I did a manual comparison to be sure that the elements in table, view and stored proc were the same and they were.
I then copied my pages (including the web.config) to the remote server.
I changed the connection string to point to the remote SQL 2005 DB instead of the SQL express DB.
I get the following 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.
The info in my web.config is:
I realize it’s probably something really stupid I’m doing wrong but I’m totally stumped and can find no help on this error anywhere.
Apr 26, 2006 07:13 AM|LINK
It seems that you problem is due to lack of applicationname. Please refer to the article:
http://weblogs.asp.net/scottgu/archive/2006/04/22/443634.aspx. to find if there is any help.
I have some further question.
1. On your local PC, do you use SQL Express or SQL Server 2005?
2. On the remote server, does it use SQL Express or SQL Server?
3. You are using a custom provider. Can you show us your connection string?
Apr 27, 2006 03:18 AM|LINK
Thanks for the reply. I tried adding the ApplicationName as described in the article and get the same results. Works like a champ on my local machine but same error on the remote server. As far as the config:
I have SQL Express 2005 on my PC
I have SQL Server 2005 on the remote site
Here's my connection string:
Apr 27, 2006 06:10 AM|LINK
1 your connection string name is "FandH123". Do you use it in your custom provider? Please check it.
2. Please ensure this connection string works properly. I know your application is migrated from SQL Express to SQL Server 2005. So the connection need to be modified correspondingly. You can refer to this article:
Apr 27, 2006 11:36 AM|LINK
Thanks for the replies. These articles are very helpful. I figured out the problem though and it was a typical bonehead mistake. I used a script to recreate all the tables for Membership. I didn't copy any data into those tables. There is a table called
aspnet_schemaversions. It requires some values to be able to validate the versions (duh). When I added these values into the table, it started working.
common 1 1
health monitoring 1 1
membership 1 1
personalization 1 1
profile 1 1
role manager 1 1
Chalk it up to the learning curve!
Jun 21, 2007 11:47 AM|LINK
You just saved my day!!!!
I had exactly the same issue and after filling in these values it works a treat.
Thanks so much!
Jul 31, 2007 03:27 AM|LINK
Thanks so much!, you also saved my day :)
Jun 24, 2008 11:15 PM|LINK
Thank you so much for posting this. You really saved me too!! [:D]
Jul 28, 2008 02:16 PM|LINK
I'll throw you a curveball... :)
I too had a SQLExpress aspnetdb.mdf I had been developing against, and I wanted to move to SQL 2005 Developer Edition. I used VSTS database tools to import the schema as a database project. I also discovered the missing schema version data and I added
a post-deployment script to create it.
I'm still getting this error, however. I've verified the schema version data is in tact and I've used "data dude" to do a schema compare with a new database that I ran aspnet_regsql.exe on. So in theory, I have 2 identical databases from both a data and
schema perspective. Any thoughts on how to debug this further?
Is there a better pattern to follow here? I'm hosting the site with a company that won't allow me to run aspnet_regsql.exe, so I really need to get this working from a .sql script.
thanks for any help!
sql membership provider
Feb 17, 2009 02:24 AM|LINK
I wish to convey my greatest gratitude to.
A saved sole