Data.DB.TBlobField.SaveToStream
Delphi
procedure SaveToStream(Stream: TStream);
C++
void __fastcall SaveToStream(System::Classes::TStream* Stream);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Data.DB.pas Data.DB.hpp |
Data.DB | TBlobField |
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;
}