procedure TForm1.btn3Click(Sender: TObject);
var
lDataSet:IDADataSet;
lConnection:IDAConnection ;
stream: Binary;
mytbl:TDAMemDataTable ;
begin
mytbl :=tbl1;
lConnection := DAConnectionManager.NewConnection(DAConnectionManager.Connections[0].Name);
lDataSet := lConnection.NewDataset('select * from db_ip', 'SQLResult');
lDataSet.Open ;
with mystreamer do
try
stream := Binary.Create;
// Writes the data
Initialize(stream, aiWrite);
WriteDataset(lDataSet, [woSchema,woRows], -1);
Finalize;
// End of write data
mytbl.Close ;
mytbl .RemoteFetchEnabled :=False;
mytbl.LocalSchema :=nil;
mytbl.LocalDataStreamer :=nil;
//read
Initialize(stream, aiReadFromBeginning);
ReadDataset('SQLResult', mytbl, true);
Finalize;
//end
finally
stream.Free;
end;
end;
end.