0
I have a table with products and another one with the category of this product. In the category table I have a detailsView with a delete button, and it deletes when a category is not associated with a product (from the other table), that is when a category is associated with a product and gives the error, instead of the user viewing the error page, I want an error warning to appear on a page or label, anything the user understands because they cannot delete the category.
error:
The DELETE statement conflicted with the REFERENCE Constraint "Fk_products_categories". The Conflict occurred in database "C: USERS DOCUMENTS VISUAL STUDIO 2013 WEBSITES PROJECT APP_DATA DBTI2.MDF", table "dbo.Products", column 'Idcategoria'. The statement has been terminated.
Since you want us to do your job, you’ll give a portion of your salary to whoever does it?
– Marciano.Andrade
It’s a legitimate question from a junior programmer. If you don’t want to help just ignore.
– Simão Lopes