firedac的数据序列和还原单元(Data.FireDACJSONReflect.pas)之拷贝FIREDAC数据集

使用流做中转

procedure CopyDataSet(const ASource, ADest: TFDAdaptedDataSet);
var
LStream: TStream;
begin
LStream := TMemoryStream.Create;
try
ASource.SaveToStream(LStream, TFDStorageFormat.sfBinary);
LStream.Seek(0, TSeekOrigin.soBeginning);
ADest.LoadFromStream(LStream, TFDStorageFormat.sfBinary);
finally
LStream.Free;
end;
end;

posted @ 2015-12-15 14:55  delphi中间件  阅读(967)  评论(0编辑  收藏  举报