When you delete a project or user, I assume there are foreign key contraints which prevent the delete statement from happening.
What should happen, especially on a system such as this, is each relevant table should have an IsDeleted bit column. So when anything in the system is deleted, the flag is marked as true. Therefore when you perform your queries you just make sure that everything shown is not deleted. This keeps data integrity intact and prevents foreign key constant problems.
Log:
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_IssueVotes_BugNet_Issues". The conflict occurred in database "BugNet", table "dbo.BugNet_IssueVotes", column 'IssueId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectCategories". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueCategoryId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectStatus". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueStatusId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectMilestones". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueMilestoneId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectIssueTypes". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueTypeId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectResolutions". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueResolutionId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectPriorities". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssuePriorityId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_IssueVotes_BugNet_Issues". The conflict occurred in database "BugNet", table "dbo.BugNet_IssueVotes", column 'IssueId'.
Comments: Cannot reproduce
What should happen, especially on a system such as this, is each relevant table should have an IsDeleted bit column. So when anything in the system is deleted, the flag is marked as true. Therefore when you perform your queries you just make sure that everything shown is not deleted. This keeps data integrity intact and prevents foreign key constant problems.
Log:
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_IssueVotes_BugNet_Issues". The conflict occurred in database "BugNet", table "dbo.BugNet_IssueVotes", column 'IssueId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectCategories". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueCategoryId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectStatus". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueStatusId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectMilestones". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueMilestoneId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectIssueTypes". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueTypeId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectResolutions". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssueResolutionId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_Issues_BugNet_ProjectPriorities". The conflict occurred in database "BugNet", table "dbo.BugNet_Issues", column 'IssuePriorityId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_BugNet_IssueVotes_BugNet_Issues". The conflict occurred in database "BugNet", table "dbo.BugNet_IssueVotes", column 'IssueId'.
Comments: Cannot reproduce