M
Matt Burland
Hi,
I have a form with many controls on it that is bound to a dataset containing
several related tables. The form will display data from one DataRow of a
main table as well as related data from a number of child tables (with 1 to
1 relations). Now I have several problems with the way this thing behaves
that all seem to relate to when (or if) the RowState of the DataRow gets
updated.
1) Changes made to the main table DO NOT update the RowState until I move to
another record
2) Moving to another record seems to set the RowState of the previous record
to Modified regardless of whether it's actually been modified! i.e. the very
act of looking at the thing seems to change it - perhaps the RowState is
imitating Schrodinger's cat!!
3) Changes to the child tables DO NOT EVER change the RowState unless I
manually iterate through all the relations and retrive all the child tables
and call Ended() on them, but that's a lot of looping that I don't think I
would have to do if the thing was working properly.
The problem caused by all of this is that when I try to update the database
it either completely ignores some changes (in the case of the child tables)
or wastes time updating rows that haven't been changed (in the case of the
main table). Also I'd like to be able to indicate to the user that the
record has been changed since they last connected to the database so they
can decide if they need to reconnect or roll back the changes they made.
Any help, thoughts or comments on this would be GREATLY appreciated.
Cheers
Matt
I have a form with many controls on it that is bound to a dataset containing
several related tables. The form will display data from one DataRow of a
main table as well as related data from a number of child tables (with 1 to
1 relations). Now I have several problems with the way this thing behaves
that all seem to relate to when (or if) the RowState of the DataRow gets
updated.
1) Changes made to the main table DO NOT update the RowState until I move to
another record
2) Moving to another record seems to set the RowState of the previous record
to Modified regardless of whether it's actually been modified! i.e. the very
act of looking at the thing seems to change it - perhaps the RowState is
imitating Schrodinger's cat!!
3) Changes to the child tables DO NOT EVER change the RowState unless I
manually iterate through all the relations and retrive all the child tables
and call Ended() on them, but that's a lot of looping that I don't think I
would have to do if the thing was working properly.
The problem caused by all of this is that when I try to update the database
it either completely ignores some changes (in the case of the child tables)
or wastes time updating rows that haven't been changed (in the case of the
main table). Also I'd like to be able to indicate to the user that the
record has been changed since they last connected to the database so they
can decide if they need to reconnect or roll back the changes they made.
Any help, thoughts or comments on this would be GREATLY appreciated.
Cheers
Matt