Solved

Cloned Dataset

Posted on 2008-06-13
6
1,073 Views
Last Modified: 2013-11-23
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
Comment
Question by:reynaldio
6 Comments
 
LVL 13

Assisted Solution

by:rfwoolf
rfwoolf earned 100 total points
ID: 21783426
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
 
LVL 4

Assisted Solution

by:Delphian
Delphian earned 100 total points
ID: 22021145
@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
 
LVL 9

Accepted Solution

by:
sun4sunday earned 150 total points
ID: 22141147
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
 
LVL 4

Expert Comment

by:Delphian
ID: 22142121
ClientDatasets are bidicional by nature. The provided dataset (the one that T<Anything>Provider links) which can be unidirectional.
0
 
LVL 2

Author Closing Comment

by:reynaldio
ID: 31466953
Thanks guys
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now