RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TParameter.LoadFromStream Method

Loads the value of a parameter from a memory stream.

Pascal
procedure LoadFromStream(Stream: TStream; DataType: TDataType);
C++
__fastcall LoadFromStream(TStream Stream, TDataType DataType);

Call LoadFromStream to copy the contents of a memory stream into a parameter. 

Stream is a reference to the memory stream from which to copy data. 

DataType is the field data type the loaded data is to be treated as.  

var
  MS: TMemoryStream;
begin
  MS := TMemoryStream.Create;
try
    ... fill memory stream with data ...
    ADOQuery1.Parameters[4].LoadFromStream(MS);
finally
if assigned(MS) then
    MS.Free;
end;
end;

 

TMemoryStream *MS = new(TMemoryStream);
try
{
  Memo1->Lines->SaveToStream(MS);
  MS->Seek(0, soFromBeginning);
  ADOQuery1->Parameters[4]->LoadFromStream(MS);
}
__finally
{
delete MS;
}

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!