DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 4 Jul 2007 10:59:30 +0800,    posted on: microsoft.public.dotnet.framework.aspnet.security        back       

Thread Index
  1    ascll
          2    Steve


How do delete registered users?   
Greetings,

If the database already uploaded, anyway to delete certain users?

As far as I known, deleting users will affected at least 4 tables, which
is: -

 - aspnet_Membership
 - aspnet_Profile
 - aspnet_Users
 - aspnet_UsersInRoles

Any table I miss out?


Question
How do totally delete users with Username like '%test%' from all affected
tables?


Kindly advise.

Thanks
ascll
Date:Wed, 4 Jul 2007 10:59:30 +0800   Author:  

RE: How do delete registered users?   
The easiest way to do this is via code in an ASP page, not SQL:
foreach (MembershipUser mu in Membership.GetAllUsers()) {
     if (mu.UserName.IndexOf("test") >=0 ) {
          Membership.DeleteUser(mu.UserName);
      }
}

If you want to do this directly in SQL server, don't manually modify the 
tables; instead, use the stored proc: aspnet_Users_DeleteUser.  

Steve

"ascll" wrote:


> Greetings,
> 
> If the database already uploaded, anyway to delete certain users?
> 
> As far as I known, deleting users will affected at least 4 tables, which
> is: -
> 
>  - aspnet_Membership
>  - aspnet_Profile
>  - aspnet_Users
>  - aspnet_UsersInRoles
> 
> Any table I miss out?
> 
> 
> Question
> How do totally delete users with Username like '%test%' from all affected
> tables?
> 
> 
> Kindly advise.
> 
> Thanks
> ascll
> 
> 
> 
Date:Mon, 16 Jul 2007 06:58:08 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us