Data.DB.TBlobField.Assign

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
Data.DB.pas
Data.DB.hpp
Unit: Data.DB
Parent: TBlobField

Delphi

procedure Assign(Source: TPersistent); override;

C++

virtual void __fastcall Assign(System::Classes::TPersistent* Source);

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();



See Also