Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1188
  • Last Modified:

Cloned Dataset

Hi all,

It's me again :) I have another question. I use clientdataset  in my application and i use clonecursor a lot.
My question is if i refresh a record using refreshrecord in the source dataset, why is it the record in the cloned dataset not updated? if i use refresh command, the cloned dataset will be updated.

Thanks,

Reynaldi
0
reynaldio
Asked:
reynaldio
3 Solutions
 
rfwoolfCommented:
Well probably because they're 2 datasets and they each have their own cursors and they each have their own recordset (otherwise, what's the point in a clone?). Think of them as two instances of the same database table. You make a change to one, the other one isn't going to know about it until it refreshes - at least that's my take on it, I could be wrong
0
 
DelphianCommented:
@rfwoolf

Actually they are 2 with two cursor but using the SAME recordset. So I believe that cds_Source.Refresh will affect the two.
0
 
sun4sundayCommented:
From Delphi Help

After calling CloneCursor, the data for the client dataset is the same as the data for Source. Edits performed by either client dataset are reflected in the data of both datasets.

Note:      Because cloned cursors are shared, changing properties that affect the cursor affect both datasets. For example, setting the ReadOnly property of either dataset will make both datasets read-only.

Call Refresh to change the base values of the current record to match the current value on the server.

clear details are in the Delphi Help
Unidirectional datasets refresh the data by closing and reopening the cursor.
Unidirectional datasets have no mechanism for locating the current record after a refresh, and always

ClientDataset is unidirectional means its a connectionless state
0
 
DelphianCommented:
ClientDatasets are bidicional by nature. The provided dataset (the one that T<Anything>Provider links) which can be unidirectional.
0
 
reynaldioAuthor Commented:
Thanks guys
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now