Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2007-12-06
13
Medium Priority
?
262 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 Ageil
ID: 20421731
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
ID: 20422203
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
ID: 20427815
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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:allanmark
ID: 20429167

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
ID: 20429214
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
ID: 20429273
Bit clueless on the sanitsiing - so I emailed them.
0
 
LVL 12

Expert Comment

by:AGBrown
ID: 20429309
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
ID: 20429412
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 1600 total points
ID: 20430115
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
ID: 20430202
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
ID: 20430962
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
ID: 20431226
0
 

Author Comment

by:allanmark
ID: 20431381
SORTED !!!

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

824 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