Add Data to an Existing ClientDataSet

Add Data to an Existing ClientDataSet

Post by Hifni Shah » Thu, 23 Dec 2004 14:43:17



Hi,
Uses: Delphi+5, MS SQL Server 2000, ADO, WindowsXP;

The method "ClientDataSet1.Data" is possible to send data from one ClientDataSet to another, by assign'n as:

ClientDataSet2.Data := ClientDataSet1.Data;

My problem here is, is it possible to append the Data from one CDS to an another ClientDataSet, keeping the existing record as it is using the "Data" property/method of ClientDataSet.

Assume that CDS2 has some records in it(take it as 200 records), and CDS1 has 100 records. Is it possible to add the 100 records of CDS1 to CDS2, which makes the Total Records to 300 of CDS2.

Regards,

Hifni Shahzard
 
 
 

Add Data to an Existing ClientDataSet

Post by Bill Tod » Thu, 23 Dec 2004 21:43:20

No. You will have to insert the records one by one.

--
Bill Todd (TeamB)
TeamB cannot answer questions received via email

 
 
 

Add Data to an Existing ClientDataSet

Post by Joe Bai » Fri, 24 Dec 2004 00:12:46


Look at the help for AppendData. If is used internally when
PacketRecords <> -1. I have issues with ApplyUpdates to the appended
records though. The CDS fields have to be exactly the same.

cds1.AppendData(cds2.Data,true);

I have scrapped useing this code in favor of this.

cds1.first;
while not cds1.eof do begin
cds2.Append;
for x := 0 to cds1.FieldCount - 1 do
cds2.Fields[x].Assign(cds1.Fields[x]);
cds2.Post;
cds1.next;
end;
cds2.MergeChangeLog;
 
 
 

Add Data to an Existing ClientDataSet

Post by Hifn » Thu, 06 Jan 2005 21:06:24

Is there anyway to even to append record from a ".cds" or ".xml" file to an
physical Table via ClientDataSet?

There are some use the term "Synchronize" in the Multitier Environment. I
wonder what mechanism does it go through. I'll be very pleased to dicuss
this topic with someone who had done "Synchronizing".