T
Tore Gylver
I have a windows form bound to a dataset. The dataset is
populated from a webservice. The dataset contains 2
tables. The dataset table that is bound to the form has
only one single row.
The operator updates data via textboxes on the form.
I have a SAVE button on the form that invokes GetChanges
on the dataset. The dataset and the source (webservice)
is updated. It works fine.
If the operator forgets to save I catch this in the forms
closing event (Dataset.HasChanges), stop the closing and
give a warning to the operator.
Then the problem arises. After the closing event is
stopped (by e.cancel set to TRUE) and the operator then
press the SAVE-button, the dataset behaves differently.
I ask for the changes:
DiffOrder = (DS_OrderGet.GetChanges
(DataRowState.Modified))
DS_OrderGet is the dataset that is bound to the form,
Difforder is a dataset of the same type.
After the cancelled closing event dataset Difforder gets
the original content from DS_OrderGet, before the user
started his update of the form.
(When the operator presses the SAVE button before the
closing event, the codeline works as expected, Dataset
Difforder gets the changes)
The "getChanges" seem to be the problem. I have figured
out a solution where I gave up "GetChanges" of
DS_OrderGet. I just updated the webservice using the
total DS_OrderGet as source. DS_OrderGet contains the
updated datarow in both cases, while Difforder does not.
My solution works fine since it is only one row in the
dataset, but would be very impractical with many rows.
Can anyone provide me with the codelines
using "GetChanges" and a "differential" dataset that will
work in both cases?
The dataset is in a baseform and the Save button in an
inherited form, but I dont think this is the reason for
the problem.
Regards
Tore Gylver
populated from a webservice. The dataset contains 2
tables. The dataset table that is bound to the form has
only one single row.
The operator updates data via textboxes on the form.
I have a SAVE button on the form that invokes GetChanges
on the dataset. The dataset and the source (webservice)
is updated. It works fine.
If the operator forgets to save I catch this in the forms
closing event (Dataset.HasChanges), stop the closing and
give a warning to the operator.
Then the problem arises. After the closing event is
stopped (by e.cancel set to TRUE) and the operator then
press the SAVE-button, the dataset behaves differently.
I ask for the changes:
DiffOrder = (DS_OrderGet.GetChanges
(DataRowState.Modified))
DS_OrderGet is the dataset that is bound to the form,
Difforder is a dataset of the same type.
After the cancelled closing event dataset Difforder gets
the original content from DS_OrderGet, before the user
started his update of the form.
(When the operator presses the SAVE button before the
closing event, the codeline works as expected, Dataset
Difforder gets the changes)
The "getChanges" seem to be the problem. I have figured
out a solution where I gave up "GetChanges" of
DS_OrderGet. I just updated the webservice using the
total DS_OrderGet as source. DS_OrderGet contains the
updated datarow in both cases, while Difforder does not.
My solution works fine since it is only one row in the
dataset, but would be very impractical with many rows.
Can anyone provide me with the codelines
using "GetChanges" and a "differential" dataset that will
work in both cases?
The dataset is in a baseform and the Save button in an
inherited form, but I dont think this is the reason for
the problem.
Regards
Tore Gylver