开发者

Sync services doesn't always update dataset

开发者 https://www.devze.com 2022-12-20 13:38 出处:网络
I am building an occasionally-connected WinForms application and have been following link text tutorial.

I am building an occasionally-connected WinForms application and have been following link text tutorial.

When using a datasheet to edit data, as the tutorial has me do, everything works fine. If, however, I bind the data to other controls on 开发者_如何学JAVAmy form, the data is not saved.

For example, I am tracking StaffID, FName, and LName. At the top of the form, I have the datasheet with these three fields. Everything works fine after I update the data and click my save button.

private void radButton1_Click(object sender, EventArgs e)
{
    this.Validate();
    this.myBindingSource.EndEdit();
    this.tableAdapterManager.UpdateAll(this.myDataSet);
}

Now, at the bottom of my form, I have three text boxes for my fields. After editing the data in these controls and clicking the save button, nothing happens. While, the controls all retain the updated data, the changes never make it to myDataSet and the info reverts back when I reload the application.

In this example, both the datasheet and my other controls are all bound to myBindingSource.

Any ideas what I might be doing wrong and ways to remedy this would be greatly appreciated!


Not really enough info here to answer properly, but I would start by making a manual call to your SyncAgents Synchronize method immeadiatley after updating the data to disk. Another common thing forgotten is to make sure that the sync direction is set to Bidirectional otherwise Server data will overwrite Client data.

Sorry its rather vauge, If you can post more detail, I can help further.

0

精彩评论

暂无评论...
验证码 换一张
取 消