I met following problem. When I assign one VT to another, the property of DisplayLabel isn't copied. So such code can produce different results:
Code: Select all
V2 := TVirtualTable.Create(Self);
V2.Assign(V1);
ShowMessage( V1.FieldByName('anyfield').DisplayLabel );
ShowMessage( V2.FieldByName('anyfield').DisplayLabel );
Code: Select all
procedure CopyDisplayLabels(ds1, ds2: TDataSet);
var
i: Integer;
begin
for i := 0 to ds1.FieldCount - 1 do
ds2.Fields[i].DisplayLabel := ds1.Fields[i].DisplayLabel
end;