Solved

Editing data within a client data set

Posted on 2002-06-18
4
146 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 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

6 Experts available now in Live!

Get 1:1 Help Now