我有一個帶有CustomerID的table_Project(鏈接到tbl_Customer)。在tbl_Customer我有CUSTOMER_ID(如鑰匙)和像電話其他一些信息,電子郵件等DELETE語句與REFERENCE衝突
要在GridView中刪除我用這個的DeleteCommand:
DeleteCommand="DELETE FROM [tbl_Customer] WHERE [Customer_ID] = @Customer_ID"
但它給我下面的錯誤:
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.
但與更新CustomerInfo我沒有得到任何錯誤。我看到了C#的不同解決方案,但我使用.net
任何想法的?
你必須首先刪除所有行關於與同一客戶ID table_Project,因爲這將是具有外鍵關係tbl_Customer –
具有u試圖刪除級聯???? – SenthilPrabhu