0

I posted my asp.net website on MVC3 live on godaddy server. How can i create admin role and add users to it? Is there an easy way to do this? Even if through sqlserver please respond with some level of code to understand better. Thanks!

NoviceMe
  • 3,126
  • 11
  • 57
  • 117

2 Answers2

0

Create it in your local database and push that up to your site in app_data. You should be able to click the small icon at the top of solution explorer to admin your site and create the roles. No code required.

Adam Tuliper
  • 29,982
  • 4
  • 53
  • 71
0

If you have already populated SQL database by copying the database to GoDaddy Server, you can use these stored procedures already present in it.

To create an admin role

EXEC    @return_value = [dbo].[aspnet_Roles_CreateRole]
    @ApplicationName = N'/',
    @RoleName = N'admin'

To add users to the role execute the stored procedure aspnet_UsersInRoles_AddUsersToRoles. Please be sure to create the user by executing aspnet_Users_CreateUser if there ain't already a user.

naveen
  • 53,448
  • 46
  • 161
  • 251