473,320 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Cannot delete user with Web Site Administration Tool

When using the Web Site Administration Tool, I get the following error when
trying to delete a user in a web application I configured to use membership,
roles, and profiles:

"An error was encountered. Please return to the previous page and try again.

The following message may help in diagnosing the problem: The DELETE
statement conflicted with the REFERENCE constraint
"FK__aspnet_Me__UserI__24285DB4". The conflict occurred in database
"GalleryServerPro2", table "dbo.aspnet_Membership", column 'UserId'. The
statement has been terminated. at
System.Web.Administration.WebAdminPage.CallWebAdmi nHelperMethod(Boolean
isMembership, String methodName, Object[] parameters, Type[] paramTypes) at
ASP.security_users_manageusers_aspx.Yes_Click(Obje ct sender, EventArgs e) at
System.Web.UI.WebControls.Button.OnClick(EventArgs e) at
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) at
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)"

The data store is SQL Server 2005, and this is all on my development PC.
Ultimately, the problem can be traced to the following line in the stored
procedure aspnet_Users_DeleteUser:

IF ((@TablesToDeleteFrom & 1) <0 AND
(EXISTS (SELECT name FROM sysobjects WHERE (name =
N'vw_aspnet_MembershipUsers') AND (type = 'V'))))

For some reason, the "SELECT from sysobjects..." is not finding a match,
causing the condition to fail, which means the following line does not
execute:.

DELETE FROM dbo.aspnet_Membership WHERE @UserId = UserId

Because this does not execute, the following subsequent SQL fails with the
constraint violation I listed at the beginning:

DELETE FROM dbo.aspnet_Users WHERE @UserId = UserId

The "SELECT name FROM sysobjects..." should return a match. In fact, it does
when I execute the query manually in a query window ("SELECT name FROM
sysobjects WHERE (name = N'vw_aspnet_MembershipUsers') AND (type = 'V')"
returns 1 record).

It boils down to this: The stored procedure is behaving as stated when using
the Web Site Administration Tool or calling Membership.DeleteUser() from an
ASPX page. However, when I step through the proc manually, using right-click
"Step Into Stored Procedure" in VS 2005, and giving it the same initial
parameter values, it works correctly! That is, the "SELECT name FROM
sysobjects..." query does not find a match using WSAT or DeleteUser(), but it
does find a match when executing the proc manually.

How can it be that the proc behaves differently depending on who calls it?
As best I can tell, the parameters are exactly the same. More importantly,
what do I need to do so that the Web Site Tool and the DeleteUser() function
works?

Another user reported the issue but without resolving it:
http://groups.google.com/group/micro...d8f7776077ffe0

Thanks for any help!
Roger Martin
www.galleryserverpro.com
www.techinfosystems.com
Mar 27 '07 #1
3 4201
Hi Roger,

From your description, you're using the ASP.NET membership service and when
using the VS 2005 Web Administration site to delete the users in the
membership database, you got error indicate that the "constraint" is
violated, correct?

Based on my research, I haven't found any exiting documented issue of the
membership delete behavior or of the web administration site. I think the
problem is likely caused by something incorrect in the ASP.NET membership's
container database. Is this the first time you encounter this error or is
it working correctly originally?

Currently, if there hasn't contained many exiting important membership data
in that database, I suggest you use aspnet_reqsql.exe to reconfigure
it(remove and readd those services). Or you can connecct to another
confgured database for testing to see whether this problem also occur.

If you have any other finding, please feel free to post here also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Mar 28 '07 #2
Thank you. Uninstalling and then reinstalling using aspnet_regsql fixed the
issue.

I have a suspicion that Team Edition for Database Professionals has
something to do with this. I have previously noticed that if you use Team Db
to import a schema from a database with the membership/role/profile
configuration, then immediately do a schema compare back to the source,
several of the membership/profile/role objects are considered "different".
When I encountered this, I clicked "Write updates" to synchronize the two,
even though they should have been identical. I didn't study the reported
differences too closely, but it had something to do with collation or some
other seemingly minor issue.

In retrospect, those differences may have played a role here. I will watch
for this in the future, and I offer this message as a helpful caution to
others.

Regards,
Roger Martin
www.galleryserverpro.com
www.techinfosystems.com
Mar 28 '07 #3
Hi Roger,

Thanks for your reply.

Yes, I've also met some similar problems from other members when try
manually moving the ASPNETdb. In most cases, it will occur runtime error
(when using the membership or other provider) due to the new database
misses some of the required components(store procedure or constraint....).

Anyway, I'm glad that you've got it working now. If you meet any new
problem or anything we can help in the future, please feel free to post
here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RickatGoIn | last post by:
We are currently using the security features included with latest .NET 2.0 Framework (v2.0.50215), including the Web Site Administration Tool. The only problem we have encountered thus far is...
1
by: RCS | last post by:
All, When I create a website locally, I have that little Administration tool (the little icon in the Solution Explorer - or under Website | Web Site Administration) - but when I connect to a 2.0...
2
by: John | last post by:
Hi Web site administration tool is great. How can I provide this functionality for the end user? I need the end user Admin to be able to list users and then change roles for any of the users or...
16
by: jblankenburg | last post by:
I am trying to deploy a simple web application to my client's production server, but it's not clear to me how MS planned on having the Security users managed without Studio. Certainly someone...
1
by: Anand | last post by:
Hi, I got the below error while trying create a user from the web site administration tool provided by Asp.NET. I'm using Active directory as a membership store. I could able to add and remove...
0
by: Lester Knutsen | last post by:
A two-day IBM Informix and DB2 User Group Technical Conference - Friday and Saturday, December 8-9, 2006 We are very please to announce our Keynote Speakers...
0
by: CharlesA | last post by:
sorry I had to clarify my previous post as I wasn't able to get specific answers so I'm made this very targetted to what I actually pretty desperate to fix. my Setup: I've got XP pro, IIS 5 ,...
0
by: Lester Knutsen | last post by:
A two-day IBM Informix and DB2 User Group Technical Conference - Friday and Saturday, December 8-9, 2006 Location - Fairview Park Marriott, Falls Church, VA (near Washington D.C.)...
1
by: ZZ_Scarab | last post by:
Hi, <I posted this on the microsoft.public.dotnet.framework.aspnet.security newsgroup but before I got a reply this newsgroup has become unavailable!! So I'm posting it here again. Sorry for the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.