The problem is in a much bigger project but I made a testproject just to find out wher the problem is
As I find out earlier I must check that close is ready before calling load and that load is redy before doing somthing with the database thats the reason for the construction .
I first do this
XDataWebDataSet1.Edit;
XDataWebDataSet1.FieldByName('SortOrder').AsInteger := WebSpinEdit1.Value;
XDataWebDataSet1.Post;
XDataWebDataSet1.ApplyUpdates;
And the close seams to have success
XDataWebDataSet1.Close;
Then I come to this
procedure TForm1.XDataWebDataSet1AfterClose(Dataset: TDataSet);
begin
XDataWebDataSet1.Load; // And this is the point wher the erros comes
end;
The rtl.js is over my programing skills to understand
ApplyUpdates is an asynchronous operation. If you cal Close right after calling it, then when the actually updates are applied, the dataset is already closed.