Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread LoadRows not showing data
Thu, May 4 2017 7:45 AMPermanent Link

Ronald

Hi,

I use LoadRows to fill a table with a JSON string which is then shown in a TGrid. This has always worked fine. But now the TGrid is empty. The RowCount gives the correct nummer of rows though. I use this code:

tbRepeatedWords.Close;
  tbRepeatedWords.Open;
  if tbPupilSettings.Columns['wRepeatedWords'].AsString<>'' then
     begin   
     tbRepeatedWords.LoadRows(tbPupilSettings.Columns['wRepeatedWords'].AsString);
     tbRepeatedWords.Columns['RepeatCount'].SortDirection:=sdDescending;
     tbRepeatedWords.Sort;
     end
  else tbRepeatedWords.LoadRows('{   "rows": [ ] }');

Has someting changed in 2.06 B1?

Greetings,
Ronald
Thu, May 4 2017 8:43 AMPermanent Link

Uli Becker

Ronald,

> I use LoadRows to fill a table with a JSON string which is then shown in a TGrid. This has always worked fine. But now the TGrid is empty. The RowCount gives the correct nummer of rows though. I use this code:
>
>  tbRepeatedWords.Close;
>    tbRepeatedWords.Open;
>    if tbPupilSettings.Columns['wRepeatedWords'].AsString<>'' then
>       begin
>       tbRepeatedWords.LoadRows(tbPupilSettings.Columns['wRepeatedWords'].AsString);
>       tbRepeatedWords.Columns['RepeatCount'].SortDirection:=sdDescending;
>       tbRepeatedWords.Sort;
>       end
>    else tbRepeatedWords.LoadRows('{   "rows": [ ] }');

Can you post the table structure of "tbRepeatedWords" and the JSON you
are trying to load from?

Uli
Thu, May 4 2017 10:03 AMPermanent Link

Ronald

Uli Becker wrote:

<Can you post the table structure of "tbRepeatedWords" and the JSON you
<are trying to load from?

Hi Uli,

The structure of tbRepeatedWords is:

Word: type dtString of length 50
RepeatCount: type dtInteger;

and the JSON is:

{   "rows": [
{ "EWB_RowID": 3, "Word": "ei-gen-schap-pen", "RepeatCount": 2 },
{ "EWB_RowID": 6, "Word": "en-zo-voorts", "RepeatCount": 2 },
{ "EWB_RowID": 2, "Word": "in-stel-lin-gen", "RepeatCount": 1 },
{ "EWB_RowID": 5, "Word": "ver-trouwd", "RepeatCount": 2 },
{ "EWB_RowID": 1, "Word": "voor-tref-fe-lijk", "RepeatCount": 1 },
{ "EWB_RowID": 4, "Word": "voorts", "RepeatCount": 1 }
] }
Thu, May 4 2017 10:43 AMPermanent Link

Ronald

Huh, the problem solved itself! The TGrid is filled now, I did not change anything...
Image