System. The Data. SqlClient. SqlException: “DELETE statement with the REFERENCE constraint” FK_news_category “conflict. The conflict occurred in database “niunan_sys”, table “dbo.news”, column “caId”.

Solutions:

Create a new query in the database:

alter table news 
drop CONSTRAINT FK_news_category
Copy the code

Then re-execute delete