Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7007713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:38:34+00:00 2026-05-27T21:38:34+00:00

for a mistake. I used a wrong command. I wanted to remove an user’

  • 0

for a mistake. I used a wrong command. I wanted to remove an user’ role from the table aspnet_UsersInRoles.
I guess that the command might be

Roles.RemoveUserFromRole(userName, origin_role);

However I used a wrong command mistakenly.

Roles.DeleteRole(origin_role,false);

Originally the table has 4 roles. Now the RoleId in the table only has two,

61572264-4935-461d-9d8c-71f147f28c34
c09f25e6-fd6a-447b-8e0d-eba0cfc94e40

How can I find and recovery them?
Many many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:38:34+00:00Added an answer on May 27, 2026 at 9:38 pm

    Below you find the source code for the function you called.
    It calls the dbo.aspnet_Roles_DeleteRole stored procedure.
    I don’t have access to an asp.net membership database at the moment, otherwise I would check for you.
    You might want to check what the stored procedure does, but as ssyladin mentioned I doubt you will be able to recover anything (since you sent the throwOnPopulatedRole argument to false).

    public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
            {
                SecUtility.CheckParameter(ref roleName, true, true, true, 256, "roleName");
                try {
                    SqlConnectionHolder holder = null;
    
                    try {
                        holder = SqlConnectionHelper.GetConnection(_sqlConnectionString, true);
                        CheckSchemaVersion( holder.Connection );
    
                        SqlCommand    cmd     = new SqlCommand("dbo.aspnet_Roles_DeleteRole", holder.Connection);
    
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.CommandTimeout = CommandTimeout;
    
                        SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int);
                        p.Direction = ParameterDirection.ReturnValue;
                        cmd.Parameters.Add(p);
                        cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName));
                        cmd.Parameters.Add(CreateInputParam("@RoleName", SqlDbType.NVarChar, roleName));
                        cmd.Parameters.Add(CreateInputParam("@DeleteOnlyIfRoleIsEmpty", SqlDbType.Bit, throwOnPopulatedRole ? 1 : 0));
                        cmd.ExecuteNonQuery();
                        int returnValue = GetReturnValue(cmd);
    
                        if( returnValue == 2 )
                        {
                            throw new ProviderException(SR.GetString(SR.Role_is_not_empty));
                        }
    
                        return ( returnValue == 0 );
                    }
                    finally
                    {
                        if( holder != null )
                        {
                            holder.Close();
                            holder = null;
                        }
                    }
                }
                catch
                {
                    throw;
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used an update command to update the whole table in an Sql
Can anyone tell me where is the mistake in the following query ALTER TABLE
I am using a badly written 3rd party (C/C++) Api. I used it from
I've got a UserControl that's used inside of an UpdatePanel. The UserControl is a
i just wanted to make a test, i'm used to work on jQuery but
I'm building a page that will be used on laptops and iPads. So, the
I guess this will be a silly mistake but for me, the following returns
I have 1 activity that receives a json object from the server (database) and
The very common beginner mistake is when you try to use a class property
A common mistake when configuring the compilation/linking/etc. settings in VC++ 2008 is to set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.