A personal repository of technical notes. - CSC

Membership.DeleteUser() Throws REFERENCE constraint Error

Problem

Membership.DeleteUser("myMembershipUser")

Threw the following error:

The DELETE statement conflicted with the REFERENCE constraint "FK__aspnet_Me__UserI__15502E78". The conflict occurred in database "MyDatabase", table "dbo.aspnet_Membership", column 'UserId'.
The statement has been terminated.


Solution

This particular issue was resolved by adding SELECT permission to view vw_aspnet_MembershipUsers:
  

use [MyDatabase]

GO

GRANT SELECT ON [dbo].[vw_aspnet_MembershipUsers] TO [MyDatabaseUser]

GO

References

"Membership.deleteUser error - ASP.NET Forums." Forums.asp.net - Home. Web. 05 Feb. 2010.
<http://forums.asp.net/t/1254087.aspx>.

No comments:

Post a Comment