Welcome Guest Search | Active Topics | Log In | Register

cannot delete a user Options · View
yafbie
#1 Posted : Wednesday, July 23, 2008 5:46:43 PM
Rank: Advanced Member


Joined: 4/17/2008
Posts: 36
There's a user that i cannot delete. Here is the event log. Can someone help?

Quote:

7/23/2008 10:43 AM in .Net SqlClient Data Provider
The DELETE statement conflicted with the REFERENCE constraint "FK_yaf_UserPMessage_yaf_PMessage". The conflict occurred in database "hcforum", table "dbo.yaf_UserPMessage", column 'PMessageID'.
The DELETE statement conflicted with the REFERENCE constraint "FK_yaf_PMessage_yaf_User1". The conflict occurred in database "forum", table "dbo.yaf_PMessage", column 'FromUserID'.
The statement has been terminated.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at yaf.DB.ExecuteNonQuery(SqlCommand cmd)
at yaf.DB.user_delete(Object UserID)
at yaf.pages.admin.users.UserList_ItemCommand(Object source, RepeaterCommandEventArgs e)
at System.Web.UI.WebControls.Repeater.OnItemCommand(RepeaterCommandEventArgs e)
at System.Web.UI.WebControls.Repeater.OnBubbleEvent(Object sender, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.RepeaterItem.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

yafbie
#2 Posted : Tuesday, August 05, 2008 11:56:38 PM
Rank: Advanced Member


Joined: 4/17/2008
Posts: 36
Anyone can help me with this? I cannot debug this.
yafbie
#3 Posted : Wednesday, August 06, 2008 9:22:37 PM
Rank: Advanced Member


Joined: 4/17/2008
Posts: 36
This is the error in VIsual studio project .

Quote:

The DELETE statement conflicted with the REFERENCE constraint "FK_yaf_UserPMessage_yaf_PMessage". The conflict occurred in database "yafforum", table "dbo.yaf_UserPMessage", column 'PMessageID'.
The DELETE statement conflicted with the REFERENCE constraint "FK_yaf_PMessage_yaf_User1". The conflict occurred in database "yafforum", table "dbo.yaf_PMessage", column 'FromUserID'.
The statement has been terminated.
The statement has been terminated.
yafbie
#4 Posted : Wednesday, August 06, 2008 10:27:36 PM
Rank: Advanced Member


Joined: 4/17/2008
Posts: 36
I found out that the user that I am trying to delete send a pm to other user, and the other user has not delete that user's pm, causing the conflict when I am trying to delete. Is there a way to resolve this? I tried with 1.9.8, the issue is still there.
yafbie
#5 Posted : Thursday, August 07, 2008 5:52:55 AM
Rank: Advanced Member


Joined: 4/17/2008
Posts: 36
Does YAF developer know about this bug? and how to fix it?
Jaben
#6 Posted : Thursday, August 07, 2008 6:53:22 AM

Rank: YAF Head Dude



Joined: 10/10/2004
Posts: 2,963
Location: Honolulu, HI
It's a bug... Fixed in newer versions of YAF.
"When you are grateful, fear disappears and abundance appears”."

yafbie
#7 Posted : Thursday, August 07, 2008 6:54:55 PM
Rank: Advanced Member


Joined: 4/17/2008
Posts: 36
Jaben, if I implement ON DELETE CASCADE, would that be a good idea or bad ?

Also, what happens if I remove the FK out?
Jaben
#8 Posted : Thursday, August 07, 2008 11:00:55 PM

Rank: YAF Head Dude



Joined: 10/10/2004
Posts: 2,963
Location: Honolulu, HI
That would be a good idea -- as it would fix your problem right now.
"When you are grateful, fear disappears and abundance appears”."

yafbie
#9 Posted : Friday, August 08, 2008 4:00:55 PM
Rank: Advanced Member


Joined: 4/17/2008
Posts: 36
Jaben, one more question if I want to put that, where is the SQL statement that I can put that on delete cascade?
Jaben
#10 Posted : Friday, August 08, 2008 10:44:09 PM

Rank: YAF Head Dude



Joined: 10/10/2004
Posts: 2,963
Location: Honolulu, HI
yaf_user_delete SPROC
"When you are grateful, fear disappears and abundance appears”."

yafbie
#11 Posted : Monday, August 11, 2008 4:47:02 PM
Rank: Advanced Member


Joined: 4/17/2008
Posts: 36
Jaben, if I implement that, the PM message gets deleted too, no? Even though the other user has not read the message yet.
Jaben
#12 Posted : Monday, August 11, 2008 10:24:33 PM

Rank: YAF Head Dude



Joined: 10/10/2004
Posts: 2,963
Location: Honolulu, HI
Yes. This is why it's not a simplistic fix and was only really fixed in newer versions.
"When you are grateful, fear disappears and abundance appears”."

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 RC2 | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.101 seconds.

SourceForge.net Logo Powered by ASP.NET v2.0 411ASP.NET