Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 3 - Client Dataset: Working with Data Packets ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Client Dataset: Working with Data Packets and Applying Updates
By: Danish Ahmed
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2008-01-09

    Table of Contents:
  • Client Dataset: Working with Data Packets and Applying Updates
  • Reconciling Errors
  • Information in Data Packets
  • Specific Fields and Custom Information

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Client Dataset: Working with Data Packets and Applying Updates - Information in Data Packets


    (Page 3 of 4 )

    Working with information in data packets

    TClientDataset/TDataset Provider components offer a number of ways to control data packets that are being transacted.

    Using the Options property of the Dataset Provider

    The Dataset Provider's Options property lets you specify a number of conditions that can be imposed when transacting data. To specify these conditions during design time, you can access these properties in the Object Inspector by expanding the Options property of TDataset Provider. To control what data manipulation operations are on the server, you can use the following options:  poDisableEdits, poDisableInserts, or poDisableDeletes.

    Setting poDisableEdits to true ensures that no existing record is modified, but it does not restrict the user from inserting a new record or deleting an existing one. poDisableInserts prevents the user from inserting a new record but it allows the user to edit or delete existing records, if the poDisableEdit and poDisableDeletes options are set to false. Finally, poDisableDeletes prevents the user from deleting records, but does not restrict the user from inserting or editing it. If you want to prevent any change to the data set the  poReadOnly property to true.

    The client dataset stores data locally, which also implies that it will always exert pressure on system resources. For this reason the client dataset does not retrieve some data, like BLOB data, by default; instead it requests it and retrieves it automatically when the need arises. Alternatively, you can also call the FetchBlobs method to load BLOB data to the dataset. However, it requires that the provider's poFetchBlobOnDemand option and the client dataset's FetchOnDemand property be set to true.

    As with BLOB data, data in the details tables of a master/detail relationship are not retrieved by default. Rather, they are retrieved only when they are needed or by using the client dataset's FetchDetails method. To enable the retrieval of records from the details table, ensure that the poFetchDetailsOnDemand property is set to true. Apart from this there are two more options that assume significance when working with the dataset representing the master/detail relationship.

    poCascadeDeletes : This option provides that when a master record is deleted, the corresponding values in detail tables are deleted too.

    poCascadeUpdates: If this option is enabled, values in the details tables are updated automatically when the master record is updated.

    You also need to set the poAllowCommandText property to true, if you want to retrieve specific sets of records using SQL, table name or stored procedure. If this property is enabled the command text is sent to the server and records returned are sent back to the client dataset. But if this property is set to false, the CommandText property of the client dataset has no impact and the associated dataset is used as the data source.

    Besides these, there are many other properties of the DatasetProvider's Option property. Refer to Delphi documentation for a complete list and descriptions.

     




    I should mention here that if you want to apply changes to the source dataset (make sure the dataset is not read-only), you can set the Dataset Provider's ResolveToDataSet property to true.

    More Delphi-Kylix Articles
    More By Danish Ahmed


     

    DELPHI-KYLIX ARTICLES

    - Loading an XML Document into the DOM
    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT