Solved

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

Posted on 2007-12-06
13
255 Views
Last Modified: 2012-06-21
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??
0
Comment
Question by:allanmark
  • 7
  • 5
13 Comments
 
LVL 27

Expert Comment

by:Sammy
Comment Utility
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
 

Author Comment

by:allanmark
Comment Utility
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
 
LVL 12

Expert Comment

by:AGBrown
Comment Utility
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
 

Author Comment

by:allanmark
Comment Utility

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
 
LVL 12

Expert Comment

by:AGBrown
Comment Utility
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
 

Author Comment

by:allanmark
Comment Utility
Bit clueless on the sanitsiing - so I emailed them.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 12

Expert Comment

by:AGBrown
Comment Utility
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
 

Author Comment

by:allanmark
Comment Utility
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
 
LVL 12

Accepted Solution

by:
AGBrown earned 400 total points
Comment Utility
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
 

Author Comment

by:allanmark
Comment Utility
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
 
LVL 12

Expert Comment

by:AGBrown
Comment Utility
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
 

Author Comment

by:allanmark
Comment Utility
0
 

Author Comment

by:allanmark
Comment Utility
SORTED !!!

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

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now