XDataWebDataSet

I'm trying to save a list by the dataset as follows:

FDataSet.Close;
FDataSet.Open;
for I := 0 to ArrayObjects.Length - 1 do
begin
FDataSet.Insert;
Item := JS.toObject(ArrayObjects[I]);
FDataSet.FieldByName('Name').AsString := JS.toString(Item['AnyName']);
FDataSet.Post;
end;
FDataSet.ApplyUpdates;

Even if ArrayObjects has more than one object inside it, the dataset only saves a record to the bank.
How do I save all items from this array?

At first sight your code is correct. I can't tell what's wrong. Do you have a sample project that we can reproduce the issue here?

1 Like