I have a simple DataSnap TCP/IP based client server application. I created a ClientDataSet on Client Application and filled it some data. Now how can I send my ClientDataSet records to Server so that I can process it and eventually save some data to server.
Edited
So I tried the below code, but the problem is that at server I am getting 1 less record than what I am sending from client
Client Code
var
cd: TClientDataSet;
begin
cd:= TClientDataSet.Create(self);
cd.Data := cdsCustomer.Data;
Memo1.Lines.Add(IntTostr( cd.RecordCount )) ;
ServerMethods1Client.TestDataSet( CD);
Server Code
function TServerMethods1.TestDataSet(ds: tdataset): string;
begin
try
DataSetProviderCommon.DataSet := ds;
if not DataSetProviderCommon.DataSet.eof then
TempClientDataSet.Open;
if TempClientDataSet.RecordCount >0 then
Form1.Memo1.Lines.Add( IntTostr( TempClientDataSet.RecordCount) )
else
Form1.Memo1.Lines.Add( ' Not records found' ) ;
DataSetProviderCommon.DataSet.Close;
except on e: Exception do
Form1.Memo1.Lines.Add('TestDataSet error :' + e.Message ) ;
end;
end;