RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomClientDataSet.SetOptionalParam Method

Saves a custom parameter with the data packet.

Pascal
procedure SetOptionalParam(const ParamName: string; const Value: OleVariant; IncludeInDelta: Boolean = False); virtual;
C++
virtual __fastcall SetOptionalParam(const AnsiString ParamName, const OleVariant Value, Boolean IncludeInDelta = False);

You can add custom information to a data packet using the SetOptionalParam method. This information is saved with the data packet when it is saved to a file or stream, and copied with the value of the Data property. For example, by setting a parameter in the OnGetData event of provider, application servers can include custom information with the data that is sent to client applications. Call GetOptionalParam to retrieve the custom information from the data packet. 

The ParamName parameter specifies the name under which the custom information is stored. It can be any value except one of the following: 

 

 

UNIQUE_KEY  
DEFAULT_ORDER  
CHANGE_LOG  
SERVER_COL  
CONSTRAINTS  
DATASET_CONTEXT  
DATASET_DELTA  
LCID  
BDERECORD_X  
TABLE_NAME  
MD_FIELDLINKS  
UPDATEMODE  

The Value parameter is an OleVariant that represents the custom information. 

The IncludeInDelta parameter specifies whether the parameter is also stored with the Delta property. By including the parameter in the Delta property, it is sent along with updates to the provider. The provider can then retrieve this information using the GetOptionalParam method of the client dataset passed as a parameter to an OnUpdateData event handler.

Note: Do not confuse the optional data saved by this method with the Params property.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!