Save dataset to stream/load dataset from stream lazarus / 16-Databases ---------------------------------------------------------------------- JD · 2011-02-15 14:18 Hi there everyone. I have a knotty problem with a 3-tier application that I'm writing. I have to send data over the network using Indy 10. a) I copy the dataset on the server side to records & send the records over the network using Indy's RawToBytes function. On the client side, Indy's ReadBytes function copies the data received into a record that is used by the client side GUI. b) I can also more or less do the same thing by sending the data in XML or JSON format over the network. (a) and (b) work very well. But I wonder, is the intermediate step of converting the data to a record, XML or JSON format really necessary? Surely one can send the dataset directly over the network and thus make the application faster. This is where I got stuck. All my efforts to copy datasets to streams & subsequently load datasets from streams have not worked thus far. I would greatly appreciate any tips / code samples that can solve this problem for me. ---------------------------------------------------------------------- denver · 2011-02-15 16:04 Try to use kbmMemTable. Version 5.6 is free for fpc. It has all the functions you need . ---------------------------------------------------------------------- JD · 2011-02-15 16:23 Quote from: denver on February 15, 2011, 05:04:38 pmTry to use kbmMemTable. Version 5.6 is free for fpc. It has all the functions you need . Is kbmMemTable free for use in commercial projects? In addition, my server side dataset is Zeos based. In general kbmMemTable is a client side component. It is not advised to use kbmMemTable on the server side. I was actually thinking of a generic way of copying a dataset to a stream & vice-versa regardless of what dataset component is being used. Besides, I have to be certain that I can use the same code/components in commercial applications. ---------------------------------------------------------------------- JD · 2011-02-15 17:03 I just realized that the TMemDataset component has LoadFromStream and SaveToStream methods.  That might do it for the client side. I'll try to "hack" the code to make it work for the server side with Zeos. ---------------------------------------------------------------------- denver · 2011-02-15 18:02 yes.  kbmMemTable 5.6 is free  even for commerical. The TMemDataSet come with Free Pascal / Lazarus contains a lot of bugs. 1. Locate is not working 2. No Sorting ---------------------------------------------------------------------- cdbc · 2011-02-16 05:25 Hi Locate is easy... Borrow code from Tdbf.Locate ?!? Sorting... Write your own, 10 min. job. Regards - Benny