Link to home
Start Free TrialLog in
Avatar of racinLFG
racinLFG

asked on

Databinding problem...changes in bound controls do not change Dataset.HasChanges to true.

I'm having a little trouble, I think relating to the DataSet.HasChanges and/or DataRow.RowState properties not reflecting changes made to a DataSet through DataBound TextBoxes on a windows form.

The form displays selected data (the DataSet is being filled successfully and the DataBindings are working). I edited the data through the TextBoxes and in debugging, the locals window shows those changes but the RowState remains Unchanged. So calling DataAdapter.Update() does nothing because the DataSet.HasChanges=false and DataRow.RowState=Unchanged.

Setting up this form using the Data Form Wizard seems to hook everything up correctly. Everything reads and writes as it should. But programmatically instantiating and filling the DataSet, defining the DataAdapter's commands, defining the controls' DataBindings, etc. causes this problem.

I set a breakpoint just after filling the DataSet initially, and just before calling DataAdapter.Update(). Both times the state properties of the DataSet reflected no change even though its data had changed.

What do I need to do to have the DataSet reflect its status accurately?
Avatar of Dranizz
Dranizz

     Me.BindingContext(objaaa, "Calls").EndCurrentEdit()
ASKER CERTIFIED SOLUTION
Avatar of Dranizz
Dranizz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial