0
我目前正在使用WPF中的DataGrid。在CellEditEnding事件中,捕获DBConcurrencyException - 第一次工作正常。要检查,我加载程序,然后更改数据库中的数据。接下来我更改DataGrid中的数据并激发异常。在catch子句中,我重新加载表数据。到目前为止,所有的事情都可以,但是当我重复这个过程时,这个例外不再被解雇。这里是我的代码重新加载数据:WPF DataGrid:DBConcurrencyException未捕获尝试catch
private void reloadData()
{
rebuildAdapter();
tables[gridNumber] = new DataTable();
adapters[gridNumber].Fill(tables[gridNumber]);
grids[gridNumber].ItemsSource = tables[gridNumber].DefaultView;
}
我错过了什么?