RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TBlobField.SaveToStream Method

Saves the contents of the BLOB field to a stream.

Pascal
procedure SaveToStream(Stream: TStream);
C++
__fastcall SaveToStream(TStream Stream);

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

Note: The Stream parameter is typically not a BLOB stream. BLOB streams (returned by the dataset's CreateBlobStream method) 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;
}

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!