Users (and roles) on SQL Server not seen in application's ASP.NET Configuration

Greetings

I have encountered something rather strange. I have a number of roles, users, etc setup for my application. This evening, I went into the ASP.NEt Configuration tool, to make some changes. Guess what - nothing!!. There are no users and no roles!!!

Not wanting to panic, I checked the tables in my database - I can see all the users!

HELP!!! ANY IDEAS WHAT HAS HAPPENEND? WHAT TO DO??
allanmarkAsked:
Who is Participating?
 
AGBrownConnect With a Mentor Commented:
Good start - now you need to find out where the other database you have loaded and are examining is, and swap the two around to get your users back.
0
 
SammyCommented:
first of all try to test the connection using the Asp.net configuration tool itself
then check your web.config for any changes

ASP.NET Configuration tool is one of the most unreliable tools out there.

0
 
allanmarkAuthor Commented:
Went to the Provider tab of ASP.Net Configuration and tested - Membership Provider and Role Provider - both  make a successful connection the database.

I can create a user - both through the Confugration tool and also through my application  - both of these users are visible to the ASP.Net Configuration tool.

Next step?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
AGBrownCommented:
Possibly a stupid question, but have you changed any settings - in particular has the ApplicationName setting changed? If you check the aspnet_Applications table is there just one entry, and if not which entries correspond to which users? Just as easy to check - did the two users you created that showed up have different applicationId values in the aspnet_Users and aspnet_Membership table to the original users?

Andy
0
 
allanmarkAuthor Commented:

Opened the aspnet_applications folder and have this:

/                         /                            24d00cee-d39f-4c94-aa70-f589274213a0      NULL
SAchoolKeeper      sachoolkeeper      ede05983-d5fc-4d67-9943-48029bca2d3a      NULL
SchoolKeeper        schoolkeeper    9394a145-4815-4d11-ac14-c0fc53f0cb24         NULL
NULL                   NULL                   NULL                                                       NULL

The users I created:

  - Do not see them in aspnet_Users
  - Do not see them in aspnet_Membership
 

Yet, I can see those usres in teh Configuration tool and my application!!!
0
 
AGBrownCommented:
It sounds like the configuration tool is using a different database - is that possible?

What are the connectionString and membershipProvider settings in your application (don't recommend posting sensitive details here - you might want to sanitise them a bit).
0
 
allanmarkAuthor Commented:
Bit clueless on the sanitsiing - so I emailed them.
0
 
AGBrownCommented:
No problem - you are using SQL Express, which is fine. I'm guessing you have the database in your App_Data folder in the web site project? Is that the database you checked to see if the users existed?

Andy
0
 
allanmarkAuthor Commented:
Aha!!

In the App_Data folder what I have is the ASPNETDB.MDF

In the applications table is:

/      /      12bf6a02-64ef-44b4-8837-87fa25b86098      NULL
NULL      NULL      NULL                                   NULL

In the Users and Membership  are the two users that I created (ASP.Net COnfig and application).

0
 
allanmarkAuthor Commented:
WHat is interesting is that I never put the MDF there (at least, not intentionally).

Can I not delete it and then right-click AppData and say "Add existing item" and go and select the database (which is somehwere under C:\Program Files\Microsoft\SQL Server \...\...") ??
0
 
AGBrownCommented:
Yup, that you can do. I would suggest this would be an opportune time to take a backup of the one you want as well.

The configuration tool will create a database if it doesn't find one.
0
 
allanmarkAuthor Commented:
0
 
allanmarkAuthor Commented:
SORTED !!!

I deleted my web.config file (after backing up!!) and then re-applied the necessary changes!!
0
All Courses

From novice to tech pro — start learning today.