473,573 Members | 4,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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__24285DB 4". The conflict occurred in database
"GalleryServerP ro2", table "dbo.aspnet_Mem bership", column 'UserId'. The
statement has been terminated. at
System.Web.Admi nistration.WebA dminPage.CallWe bAdminHelperMet hod(Boolean
isMembership, String methodName, Object[] parameters, Type[] paramTypes) at
ASP.security_us ers_manageusers _aspx.Yes_Click (Object sender, EventArgs e) at
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) at
System.Web.UI.W ebControls.Butt on.RaisePostBac kEvent(String eventArgument) at
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) at System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) at
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) at
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint,
Boolean includeStagesAf terAsyncPoint)"

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_De leteUser:

IF ((@TablesToDele teFrom & 1) <0 AND
(EXISTS (SELECT name FROM sysobjects WHERE (name =
N'vw_aspnet_Mem bershipUsers') 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_Memb ership 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_User s 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_Mem bershipUsers') 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.Dele teUser() 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 4219
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.e xe 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(stor e 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
3424
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 getting the Web Site Administration Tool to install and work on the IIS Server. To clarifty, we can only access the Web Site Administration Tool for...
1
1733
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 webhost (and the rest of the site compiles fine under 2.0) - I don't have that option. More specifically, I want this tool so I can easily setup...
2
1684
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 to be able to disable any of the users. Thanks Regards
16
15946
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 has run into this issue. How do you manage users (the ones you would normally manage with the Web Site Administration Tool) without Studio to get you...
1
1478
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 users earlier from this, after this I want to implement the password reset option and to that i've added couple of (5 attributes) to the active...
0
2604
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 --------------------------------------------------- * Friday, December 8, 2006 – Ambuj Goyal, General Manager of IBM Information Management * Saturday, December 9,2006 - Arvid Krishna,...
0
1795
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 , visual Studio 2005, asp.net 2.0 and C#, I have SQL server 2005 installed as well. if I create a web site with the internal web server of VS2005,...
0
2060
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.) ************************************************************************************************** Web site at:...
1
10709
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 inconveneice.> I tried using the ASP.Net Web Site Administration Tool to setup security for a web site I'm creating using VS 2005 C#. When...
0
8037
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7799
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3737
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3742
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2226
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1048
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.