答案 0 :(得分:0)
您必须实现SQL DataTable
事件处理程序,如下所示:
YourDataTable.RowDeleted += new DataRowChangeEventHandler(dataTable_RowChanged);
private void dataTable_RowChanged(object sender, DataRowChangeEventArgs e)
{
DataRow _dr = e.Row as DataRow;
try
{
if (e.Row.RowState == DataRowState.Deleted)
{
// YOUR CODE
}
if (e.Row.RowState == DataRowState.Added) { //OPTIONAL }
if (e.Row.RowState == DataRowState.Modified) { //OPTIONAL}
}
catch (Exception ex) { }
finally { _dr = null; }
}
希望这可能会有所帮助。最好的问候,