RAD Studio VCL Reference
|
Loads BLOB data from a stream into the field.
procedure LoadFromStream(Stream: TStream);
__fastcall LoadFromStream(TStream Stream);
Use LoadFromStream to copy the contents of a stream into the BLOB field. Specify the stream from which the field's value is copied as the value of the Stream parameter.
var MS: TMemoryStream; begin if not (ClientDataSet1.State in [dsInsert, dsEdit]) then ClientDataSet1.Insert; MS := TMemoryStream.Create(); try Image1.Picture.Bitmap.SaveToStream(MS); ClientDataSet1Images.LoadFromStream(MS); finally MS.Free; end; ClientDataSet1.Post; end;
if ((ClientDataSet1->State != dsInsert) && (ClientDataSet1->State != dsEdit)) ClientDataSet1->Insert(); TMemoryStream *pMS = new TMemoryStream; try { Image1->Picture->Bitmap->SaveToStream(pMS); ClientDataSet1Images->LoadFromStream(pMS); } __finally { delete pMS; } ClientDataSet1->Post();
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|