Databinding to a dataview - dataset does not think its been modified.

  • Thread starter Thread starter Steven C
  • Start date Start date
S

Steven C

Hi, can any one help with this frustrating problem.

I have a dataset filled from a Jet database via a paramaterised query.

I dynamically bind each control to a dataview each time a next /
previous button is pressed. Each control is also dynamically created.
The dataset reflects the underlying changes on the form when I go back
and forth between pages. The problem is when I try to call the
DataAdapter.Update() method it is not called because the dataset does
not think it has been changed.

DataRowState.Modified is always false even though the changes are
there for inspection.

Help!
 
Steven,

Try calling EndCurrentEdit() on all of the currency managers before
unbinding the controls and calling Update() on the data adapter.
 
Dmitriy

Thanks for the reply but I am not using any currency managers. Maybe
this is the problem? I bind to a dataview on one page then dispose the
control and recreate the bindings. The pages contain data bound to
different tables in a dataset dependent on a condition so the controls
are always different varying between a text box, n radio buttons or n
checkboxes.

Does it matter that the data in the dataset comes from an access query
that is read only?

Thanks again for your reply.

Steven
 
I am close!
If I add a DataGrid to the form and bind the dataset to that
and add changes in my dataview then still the dataset does not know it
has changes.

However, if I go the datagrid and look at the changes - place the cursor
in the changed row - but don't make any changes - then the dataset
suddenly knows it's been changed.

I can only assume that the datagrid is calling a method behind the
scenes. Do you know what that method is?

Steven
 
Back
Top