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 8769539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:22:08+00:00 2026-06-13T17:22:08+00:00

I am using the built in role and membership management tool for asp.net on

  • 0

I am using the built in role and membership management tool for asp.net on my website. I am currently in the process of upgrading the abilities of the site so that the site admin can add/delete roles, and manage the access of the different roles from inside a page on the site. However, when I execute

System.Web.Security.Roles.CreateRole(roleName); //Where roleName is a string value of the role that I am creating, and it is not a duplicate name.

I get the error message

System.Data.SqlClient.SqlException: Conversion failed when converting from a character string to uniqueidentifier.

The site is running on shared hosting and I am using the ASP.NET tables, triggers, and stored procedures. What is odd is that I have had no trouble updating users to roles, creating users, deleting users, resetting passwords, etc. using the built in methods. Is it possible that the stored procedure that the system created for me was in some way flawed and is not returning all of the data that it needs to execute? If not, then what else could be the cause of the issue?

  • 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-06-13T17:22:09+00:00Added an answer on June 13, 2026 at 5:22 pm

    Here’s the Create Role SP:

    CREATE PROCEDURE [dbo].[aspnet_Roles_CreateRole]
    @ApplicationName  nvarchar(256),
    @RoleName         nvarchar(256)
    

    AS
    BEGIN
    DECLARE @ApplicationId uniqueidentifier
    SELECT @ApplicationId = NULL

    DECLARE @ErrorCode     int
    SET @ErrorCode = 0
    
    DECLARE @TranStarted   bit
    SET @TranStarted = 0
    
    IF( @@TRANCOUNT = 0 )
    BEGIN
        BEGIN TRANSACTION
        SET @TranStarted = 1
    END
    ELSE
        SET @TranStarted = 0
    
    EXEC dbo.aspnet_Applications_CreateApplication @ApplicationName, @ApplicationId OUTPUT
    
    IF( @@ERROR <> 0 )
    BEGIN
        SET @ErrorCode = -1
        GOTO Cleanup
    END
    
    IF (EXISTS(SELECT RoleId FROM dbo.aspnet_Roles WHERE LoweredRoleName = LOWER(@RoleName) AND ApplicationId = @ApplicationId))
    BEGIN
        SET @ErrorCode = 1
        GOTO Cleanup
    END
    
    INSERT INTO dbo.aspnet_Roles
                (ApplicationId, RoleName, LoweredRoleName)
         VALUES (@ApplicationId, @RoleName, LOWER(@RoleName))
    
    IF( @@ERROR <> 0 )
    BEGIN
        SET @ErrorCode = -1
        GOTO Cleanup
    END
    
    IF( @TranStarted = 1 )
    BEGIN
        SET @TranStarted = 0
        COMMIT TRANSACTION
    END
    
    RETURN(0)
    

    Cleanup:

    IF( @TranStarted = 1 )
    BEGIN
        SET @TranStarted = 0
        ROLLBACK TRANSACTION
    END
    
    RETURN @ErrorCode
    

    END

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using built-in asp.net Role and membership provider in my website. when user
I am using built-in asp.net Roles and membership provider in my website. what i
i am using asp.net built-in membership and role provider. In my application Admin Create
I am using the ASP.NET inbuilt login and role management solution (creates table like
I'd like to use the built in ASP.NET membership and role providers to create
looking for some feedback on the built in membership and roles management for ASP.Net
Having built myself a decent website using ASP.NET MVC, I'm about to build an
I've been able to find lots of stuff about using the ASP .NET Membership
I'm using ASP.NET MVC2 RC and I have built security on top of the
I am using the built in authentication in ASP.Net. I want to make it

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.