Solved

Editing data within a client data set

Posted on 2002-06-18
4
152 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

23 Experts available now in Live!

Get 1:1 Help Now