Archive

Posts Tagged ‘Membership’

The DELETE statement conflicted with the REFERENCE constraint in membership table

January 30, 2013 Leave a comment

To delete a user from the database i used ‘Membership.DeleteUser(user)‘ while doing smoke test it is working in development environment but not in testing environment.

The DELETE statement conflicted with the REFERENCE constraint “FK__aspnet_Us__UserI__47489C52”. The conflict occurred in database “TestDB”, table “dbo.aspnet_UsersInRoles”, column ‘UserId’.

After analysis the ‘aspnet_Users_DeleteUser‘ procedure i came to know all the views for aspnet membership are missing

using ‘SELECT * FROM sysobjects where type = ‘V’

Refrence: Roles and Views in the Application Services Database for SQL Server

Advertisements

Using aspnet_regsql via the command line to setup membership roles

December 21, 2012 Leave a comment

Open the command promt with admin rights and change the directory to

C:\WINDOWS\Microsoft.NET\Framework\<versionNumber>\

You can run the Aspnet_regsql.exe tool as a command-line utility

Aspnet_regsql.exe –S servername –d databasename –U username –P password –A <optionsto be install>

After install

AfterInstalling

To Uninstall

Remove Memebrship and roles

Referance : http://msdn.microsoft.com/en-us/library/x28wfk74(v=vs.100).aspx

%d bloggers like this: