Data.DB.TBlobField.Assign
Delphi
procedure Assign(Source: TPersistent); override;
C++
virtual void __fastcall Assign(System::Classes::TPersistent* Source);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Data.DB.pas Data.DB.hpp |
Data.DB | TBlobField |
Description
Copies a value to the BLOB field.
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();