RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TBlobField.Assign Method

Copies a value to the BLOB field.

Pascal
procedure Assign(Source: TPersistent); override;
C++
virtual __fastcall Assign(TPersistent * Source);

Use Assign to copy data to the BLOB field. Assign copies the Value of a BLOB field from 

Another BLOB field 

A TStrings object 

A TPicture or TBitmap object, if the BlobType is ftGraphic or ftTypedBinary 

Any object that supports TBlobField in its AssignTo method 

In the example below, the Assign method is used to copy the bitmap from a TImage component into a BLOB field through its TBlobField field object:

if not (ClientDataSet1.State in [dsInsert, dsEdit]) then
  ClientDataSet1.Insert;
ClientDataSet1Images.Assign(Image1.Picture);
ClientDataSet1.Post;

 

if ((ClientDataSet1->State != dsInsert) &&
(ClientDataSet1->State != dsEdit))
  ClientDataSet1->Insert();
ClientDataSet1Images->Assign(Image1->Picture);
ClientDataSet1->Post();

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!