Author: bradgil | Posted on: 7/19/2009 6:33:19 PM | Views : 438

I Create a user with the CreateUser Wizard and all is OK - 1 record in aspnet_Users table, and 1 record in aspnet_Membership table with matching UserId.  Then I add user to roles:
if (!Roles.IsUserInRole(username, rolename))
   Roles.AddUserToRole(username, rolename);

I end up with 2 records with same UserName in aspnet_Users - different UserIds (old and new), the aspnet_Membership table is unchanged, and aspnet_UsersInRoles table has the new UserId associated with the role.  All is fine until I delete the user - I'm left with a record in aspnet_Users with the new UserId.
Why is a duplicate UserName record with a new User ...

Go to the complete details ...