TynSerial序列(还原)TClientDataSet
可以一次性序列(还原)多个TClientDataSet。
procedure TForm1.Qrys(accountno, sql, sql2: string; DataSet, DataSet2: TClientDataSet); // TClientDataSet主从表查询 var url: SockString; i: integer; serial: TynSerial; begin serial := TynSerial.Create; try url := 'querys2'; serial.WriteString('accountno', accountno); // 帐套号 serial.WriteString('sql', sql); // 查询SQL serial.WriteString('sql2', sql2); i := FHttp.Post(url, serial.Text, FDataType); // http post if i = 200 then begin serial.Text := FHttp.Content; serial.ReadClientDataSet('dataset', DataSet); // 还原一 serial.ReadClientDataSet('dataset2', DataSet2); // 还原二 end else ShowMessage(IntToStr(i) + ' error'); finally serial.Free; end; end;