Data.DB.TBlobField.SaveToStream

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 SaveToStream(Stream: TStream);

C++

void __fastcall SaveToStream(System::Classes::TStream* Stream);

Description

Saves the contents of the BLOB field to a stream.

Use SaveToStream to copy the contents of a BLOB field to a stream. Specify the name of the stream to which the value of the field is saved as the value of the Stream parameter.

Note: The Stream parameter is typically not a BLOB stream. BLOB streams (returned by the CreateBlobStream method of the dataset) provide a completely separate mechanism for streaming data from a BLOB field.



var
MS: TMemoryStream;
begin
MS := TMemoryStream.Create;
try
SQLDataSet1Images.SaveToStream(MS);
Image1.Picture.Bitmap.LoadFromStream(MS);
finally
MS.Free;
end;
end;



TMemoryStream *pMS = new TMemoryStream;
try
{
SQLDataSet1Images->SaveToStream(pMS);
Image1->Picture->Bitmap->LoadFromStream(pMS);
}
__finally
{
delete pMS;
}



See Also