Answer the question
In order to leave comments, you need to log in
How to properly load data into ListView?
Loading data from sqlite into listview.
But as a result, FDQuery1 is loaded correctly, in turn, but FDQuery2 is loaded for the same questions.
This is understandable.
for i:=0 to FDQuery1.Record Count-1 do
I tried like this:
for i:=0 to FDQuery1.RecordCount -1 and FDQuery2.RecordCount -1 do
doesn't help...
ListView1.Items.Clear;
FDQuery1.Close;
FDQuery2.Close;
FDQuery1.Active:=True;
FDQuery2.Active:=True;
FDQuery1.SQL.Clear;
FDQuery2.SQL.Clear;
FDQuery1.SQL.Add('select question from datai');
FDQuery2.SQL.Add('select answer from datai');
FDQuery1.OpenOrExecute;
FDQuery2.OpenOrExecute;
ListView1.BeginUpdate;
for i:=0 to FDQuery1.RecordCount -1 and FDQuery2.RecordCount -1 do
begin
mr :=(FDQuery1.FieldByName('question').AsString);
mr2 :=(FDQuery2.FieldByName('answer').AsString);
ListView1.Items.Add.Data['result] := mr+chr(13)+chr(13)+mr2;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question