I have a table_Project with a CustomerID in it (linked to tbl_Customer). In tbl_Customer I have Customer_ID(as key) and some other info like Phone, Email etc.
To delete it from the Gridview I use this DeleteCommand:
DeleteCommand="DELETE FROM [tbl_Customer] WHERE [Customer_ID] = @Customer_ID"
But it gives me the following error:
The DELETE statement conflicted with the REFERENCE constraint "Klant_Relatie". The conflict occurred in database "Database_1", table "dbo.tbl_Project", column 'CustomerID'.
The statement has been terminated.
But with updating the CustomerInfo I do not get any error. I have seen different solutions for C# but I use .net
Any idea's?
You cannot delete the client if he is referenced by a project.. That's what the error means..
I don't understand your
I have seen different solutions for C# but I use .net
But you have different solutions here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With