ASP.NET 2.0: Roles.AddUserToRole(...) SqlException

I

ijoxley

I am having trouble adding any user to a role using
Roles.AddUserToRole(username, rolename): whenever I call this method I
receive an SqlException along the lines of:

Violation of UNIQUE KEY constraint 'IX_aspnet_Users_UserName'. Cannot
insert duplicate key in object 'aspnet_Users'.
The statement has been terminated.

This to me seems to indicate that it is trying to add a new record to
the aspnet_Users table - all I am trying to do is modify the roles
assigned to an existing user.

I get this same error when trying to manage user roles using the
ASP.NET Configuration tool in VS 2005.

Has anyone else come across a similar problem?

Thanks

Ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top