Data.Win.ADODB.TParameter.LoadFromStream

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure LoadFromStream(Stream: TStream; DataType: TDataType);

C++

void __fastcall LoadFromStream(System::Classes::TStream* Stream, TDataType DataType);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB TParameter

Description

Loads the value of a parameter from a memory stream.

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;
}



See Also