[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Editing data within a client data set

Posted on 2002-06-18
4
Medium Priority
?
176 Views
Last Modified: 2010-04-04
Hi guys,

I am wondering if you could help.  I am using a TSQLClientDataSet to pull data from several tables.  I have added two additional columns to the TSQLClientDataSet and you like to add data to these columns once the initial retrieve has occurred.  Any ideas on how to do this?  

Cheers,
Paul
0
Comment
Question by:gtbikeuk
4 Comments
 
LVL 1

Accepted Solution

by:
Kristian earned 800 total points
ID: 7088483
Hi Paul,

You can update a TClientDataSet just like a TTable,
if your using DB controls then its easy and use TDataSource, otherwise by code just goto the row you want and update the Data.

For Updating a row Use :

FClientDataSet.Edit;
FClientDataSet[ColName] := Value;
FClientDataSet.Post;

For Adding a row and editing it Use :

FClientDataSet.Append;
FClientDataSet[ColName] := Value;
FClientDataSet.Post;

(Note : FClientDataSet[ColName] is the same as FClientDataSet.Fields[ColName]  )

Kristian

0
 
LVL 4

Expert Comment

by:YodaMage
ID: 7089017
Keep one thing in mind. If you are creating a CDS with data from a join or union, you can add data to that CDS as shown above, but you CANNOT .applyupdates, so the data you add cannot post to the server.
0
 

Expert Comment

by:CleanupPing
ID: 9343185
gtbikeuk:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9453447
gtbikeuk,
No comment has been added lately (17 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to Kristian http:#7088483

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

831 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