I have tryed
to delete a document type in my project and I'm getting the follow message:
Error
handling action
There was an
error processing the request.
The log
viewer error shows:
At
/umbraco/settings/editNodeTypeNew.aspx?id=1082 (Referred by: http://butao.autotrac.com.br/umbraco/settings/editNodeTypeNew.aspx?id=1082):
umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper
exception in ExecuteNonQuery ---> System.Data.SqlClient.SqlException: The
DELETE statement conflicted with the REFERENCE constraint
"FK_cmsPropertyData_cmsPropertyType". The conflict occurred in
database "umbraco", table "dbo.cmsPropertyData", column
'propertytypeid'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean
breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName,
Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String
connectionString, CommandType commandType, String commandText, SqlParameter[]
commandParameters)
at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText,
IParameter[] parameters)
--- End of inner exception stack trace ---
at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText,
IParameter[] parameters)
at umbraco.cms.businesslogic.propertytype.PropertyType.delete()
at umbraco.controls.ContentTypeControlNew.gpw_Delete(Object sender, EventArgs
e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)
Hi. I've already seen something not exactly the same but very similar. That time I defeated it by simply turning on the "cascade delete" option on the FK causing the error. (Yeah, I stand against changing the database, but it just looked like the simplest way and actually you can turn cascade deletion back off right after performing what you need).
Deleting property from doc-type throws exception
I have tryed to delete a document type in my project and I'm getting the follow message:
Error handling action
There was an error processing the request.
The log viewer error shows:
At /umbraco/settings/editNodeTypeNew.aspx?id=1082 (Referred by: http://butao.autotrac.com.br/umbraco/settings/editNodeTypeNew.aspx?id=1082): umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery ---> System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "umbraco", table "dbo.cmsPropertyData", column 'propertytypeid'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)
at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)
--- End of inner exception stack trace ---
at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)
at umbraco.cms.businesslogic.propertytype.PropertyType.delete()
at umbraco.controls.ContentTypeControlNew.gpw_Delete(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I have no idea how to fix it.
Can someone help me, please?
Hi. I've already seen something not exactly the same but very similar. That time I defeated it by simply turning on the "cascade delete" option on the FK causing the error. (Yeah, I stand against changing the database, but it just looked like the simplest way and actually you can turn cascade deletion back off right after performing what you need).
Hey Rodion,
Thank you very much. I'll try it.
Mila
is working on a reply...