C# SQL DataBinder 更改未保存

C# SQL DataBinder changes not saved

我设置了数据绑定器和绑定导航器,这在“保存”按钮代码中:

    private void cT_detimpBindingNavigatorSaveItem_Click_1(object sender, EventArgs e)
    {
        this.Validate();
        this.cT_detimpBindingSource.EndEdit();
        this.BindingContext[rDataSet.CT_detimp].EndCurrentEdit();
        this.tableAdapterManager.UpdateAll(this.rDataSet);

    }

我设置了断点以确保程序到达这部分代码。我更改了其中一个字段并更改了记录,然后单击保存。我追踪到 tableAdapterManager.UpdateAll --> 到 public virtual int UpdateAll(RDataSet dataSet)dataSet.HasChanges() == false。我不知道为什么它会是假的。我做了改变。请帮忙。我已经尝试将 .AcceptChangesDuringUpdate 和 .AcceptChangesDuringFill 设置为 true 和 false 的所有组合。

问题是我使用自己的 SQL 加载数据。当我从 Form_Load 方法中取出该代码并仅使用我使用 VS 数据集向导定义的数据集时,它工作正常。这是 Form_Load 中剩下的所有内容:

this.cT_detimpTableAdapter.FillByErrStat(this.rDataSet.CT_detimp);