TDBGrid not showing correct data lazarus / 16-Databases ---------------------------------------------------------------------- mangakissa · 2014-03-13 10:47 I've created a very basic workbench for select queries. The created query will be put in TSQLQuery.SQL.text. TSQLQuery runs the query and give it to TMemdataset. Code: [Select]procedure TDMworkbench.DBGetData(sl: TStrings); begin   try     MemDataset.DisableControls;     if MemDataset.Active then       MemDataset.Active := false;     SQLQuery.SQL.Text := sl.Text;     SQLQuery.Active := true;     Memdataset.Clear;     MemDataset.CopyFromDataset(SQLQuery);     MemDataset.Active := true;     SQLTransaction.Commit;   finally     MemDataset.EnableControls;   end; end;                            The first query shows all fields right in TDBGrid (attachment 1), but running a second query shows garbage (attachment 2). But it should be showed like attachment 3. When not using TMemdataset.DisableContols TDBGrid shows data correctly, but it's very slow. Is this a bad behavior of TDBGrid and can it be fixed on another way? ---------------------------------------------------------------------- taazz · 2014-03-13 11:26 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TDMworkbench.DBGetData(sl: TStrings);begin  if MemDataset.Active then MemDataset.Active := false;  MemDataset.DisableControls;  try    SQLQuery.SQL.Text := sl.Text;    SQLQuery.Active := true;    Memdataset.Clear;    MemDataset.CopyFromDataset(SQLQuery);    SQLTransaction.Commit;  finally    MemDataset.EnableControls;    MemDataset.Active := true;  end;end; Try the above and see if that helps at all, keep in mind I'm just playing around at this point mostly because I'm not in the mood of testing code around today. ---------------------------------------------------------------------- mangakissa · 2014-03-13 13:21 No, it still give garbage on the second query. QuoteI'm not in the mood of testing code around today.Offcourse not. The whether today is perfectly for most people (for me it is )