Die*_*EEn 4 sql sql-server asp.net sql-delete
我有一个table_Project,其中包含CustomerID(链接到tbl_Customer).在tbl_Customer中,我有Customer_ID(作为密钥)和其他一些信息,如电话,电子邮件等.
要从Gridview中删除它,我使用此DeleteCommand:
DeleteCommand="DELETE FROM [tbl_Customer] WHERE [Customer_ID] = @Customer_ID"
Run Code Online (Sandbox Code Playgroud)
但它给了我以下错误:
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
有任何想法吗?
如果项目引用了客户端,则无法删除客户端.这就是错误的含义.
我不明白你的意思
我已经看到了C#的不同解决方案,但我使用.net
但是你有不同的解决方案:
| 归档时间: |
|
| 查看次数: |
5870 次 |
| 最近记录: |