Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 15th, 2006, 07:24 AM
Registered User
 
Join Date: May 2006
Location: Milton Keynes, , United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default asp.net 2 custom membership provider

I've been trying for ages to make a custom membership provider work on my hosted web site. I created a SQL 2000 database by scripting the default aspnetdb.mdf to the host site database (which I have no direct access to, nor can I even rename it)

I've added this to my web.config file:

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

but I now get this error message when trying to log on:

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.

I'm not really clued up on this, but now I'm completely flummoxed! Can anybody tell me what I@m doing wrong?
  #2 (permalink)  
Old May 15th, 2006, 01:06 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,050
Thanks: 80
Thanked 1,581 Times in 1,558 Posts
Default

Hi Andyw,

Did you only script the structure of the tables, views, stored procedures etc? Or did you also copy over the data?

The aspnet_SchemaVersions data contains a number of important records. It holds the version number of the present schema in the database for each feature that uses that database. This schema table is used to make future upgrades easier.

Whenever a feature is started up, it checks the schema version table to see if that database has a compatible schema. In your case, this table may be empty, and thus you get the error you see...


HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #3 (permalink)  
Old May 15th, 2006, 02:56 PM
Registered User
 
Join Date: May 2006
Location: Milton Keynes, , United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar

Thank you very much indeed for your fast reply. I've checked the aspnet_SchemaVersions table, and you're right - There's no content. What must I enter to get things going?

Regards,

Andy W
  #4 (permalink)  
Old May 15th, 2006, 03:04 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,050
Thanks: 80
Thanked 1,581 Times in 1,558 Posts
Default

Hi Andy ,

A default installation of an Aspnetdb.mdf database has this:

Feature CompatibleSchemaVersion IsCurrentVersion
common 1 True
health monitoring 1 True
membership 1 True
personalization 1 True
profile 1 True
role manager 1 True

But it's probably easier to look at an existing database of yours and copy the records over.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: And Me by Beastie Boys (Track 11 from the album: Hello Nasty) What's This?
  #5 (permalink)  
Old May 15th, 2006, 03:07 PM
Registered User
 
Join Date: May 2006
Location: Milton Keynes, , United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again, Imar

I just copied all the content of my aspnet_SchemaVersions table, and Bingo!

You're a very VERY good man - I've been struggling with this for weeks.

Many thanks again

Andy W
  #6 (permalink)  
Old May 15th, 2006, 03:19 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,050
Thanks: 80
Thanked 1,581 Times in 1,558 Posts
Default

You're welcome. You should have come to this place sooner... ;)

Glad it's working. Isn't it nice to discover step by step how the inner workings of ASP.NET 2 operate? Something new to discover every day.....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Deep by Pearl Jam (Track 10 from the album: Ten) What's This?
  #7 (permalink)  
Old May 15th, 2006, 05:19 PM
Registered User
 
Join Date: May 2006
Location: Milton Keynes, , United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again, Imar

Yes, you're right - I should have checked here before. I got the URL from your excellent Professional ASP.NET 2.0 Security, Membership, and Role Management book, which between it and you have solved weeks of headaches in 24 hours!

More power to you.

Andy W
  #8 (permalink)  
Old May 16th, 2006, 02:07 AM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,050
Thanks: 80
Thanked 1,581 Times in 1,558 Posts
Default

Unfortunately, Professional ASP.NET 2.0 Security, Membership, and Role Management is not my book. It's another Wrox book by Stefan Schackow.

I wish it was mine though, as it's easily *the* best book I have seen on the subject....... ;)

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #9 (permalink)  
Old August 19th, 2006, 07:21 AM
Registered User
 
Join Date: Apr 2006
Location: , , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I Imar,

I wonder if you could work your magic on the same symptom but a different cause?

The 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 I have done:
1. Developed site and DB localy - they work
2. Created empty db via a SQL compare tool from Red Gate on my hosting account
3. Ran the aspnet_regsql.exe against my live db. - It worked
4. Ran my site localy but with a changed web.config to point to the new DB
5. Came up with the above error.
6. Read this forum post and checked the table which was fine and had all the data in it you said to check.

Not sure what to do now,

Any ideas?

Danny


Danny
  #10 (permalink)  
Old August 19th, 2006, 07:58 AM
Registered User
 
Join Date: Apr 2006
Location: , , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Problem solved!

Once I uploaded the site and ran it from the server, it was fine. It obviously didnt like being run from my machine with a remote DB!

Thanks anyway - just in case you were planning on replying! :)

Danny
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Membership Provider Scott663 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 August 1st, 2008 06:16 PM
Custom Membership Provider kulkarnimonica ASP.NET 2.0 Professional 0 June 21st, 2007 04:56 PM
ASP.NET SQL Membership Provider bignermo ASP.NET 2.0 Professional 2 March 20th, 2007 06:41 AM
Simple ASP.NET Membership Provider Login jumpseatnews ASP.NET 2.0 Basics 0 July 16th, 2006 11:53 AM
custom membership provider msrnivas General .NET 1 September 18th, 2005 05:28 AM



All times are GMT -4. The time now is 01:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.