0
我使用的BindingSource在我的形式刪除記錄:的BindingSource刪除當前
try
{
BindingSource1.RemoveCurrent();
BindingSource1.EndEdit();
Table1TableAdapter.Update(dataSet01.Table1);
}
catch (Exception ex)
{
MessageBox.show(ex.Message);
}
如果涉及到另一條記錄,在第一個用戶看到這條記錄刪除,但之後會出現一個錯誤。我怎樣才能防止先刪除相關記錄;所以不會顯示錯誤。
「但之後會出現錯誤。」什麼錯誤?這是違反外交禁忌的嗎?你能發佈錯誤信息嗎?你能發佈關於你的表格結構的信息嗎? –
是的,錯誤是違反外鍵違規行爲。 – user422481