I am trying to stream a delphi TDAMemDataTable to a .NET System.Data.DataTable but get an error when deserializing.
I currently get exception RemObjects.DataAbstract.DAException: ‘Unexpected end of stream’
Note: The binary data gets passed through an intermediate RO client/server but I assume this should not matter.
Should this work? What is wrong with the code?
My delphi client code:
function UploadCloudData(DataTable:TDAMemDataTable): Boolean;
var
tabledata:Binary;
streamer:TDABin2DataStreamer;
begin
tabledata:=nil;
try
streamer:=TDABin2DataStreamer.Create(nil);
try
tabledata:=Binary.Create();
streamer.WriteDataset(tabledata,DataTable,[woSchema,woRows],-1);
finally
streamer.Finalize();
FreeAndNil(streamer);
end;
Result:=(Service as IPharmacyCloudService).UploadCloudData(tabledata);
end;
My .NET server code:
var streamer = new RemObjects.DataAbstract.Bin2DataStreamer();
var stream = new System.IO.MemoryStream(tabledata.ToArray());
var dataTable = new System.Data.DataTable(tablename);
//var schema = streamer.ReadDataTableSchema(queryinfo.tablename);
streamer.ReadDataTable(stream, tablename, dataTable, true, true);
Thanks for the info.
Meanwhile I have added WriteDelta which looks OK but I do not succeed in enabling ReducedDelta.
Regardless of the streamer SendReducedDelta parameter the Delta.FieldsFilter appears to contain all fields instead of only the modified ones.
How can I enable reduced delta for a TDAMemDataTable?
The HasReducedDelta property is readonly contrary to what the documentation shows.
Note: I test by performing an insert + apply and then a modification of a single field. I evaluate the delta before the next apply.