hi to all,

i want to save a file to a ms sql server database table
first i create a row (or column which one i dont know)
EkFile -> varbinary -> 50

then at delphi i wrote these lines

DSTemp: TAdoDataSet;
Blob: TStream;
fs: TFileStream;

if St[8] <> '' then
begin
Blob := DSTemp.CreateBlobStream(DSTemp.FieldByName('EkFile '), bmWrite);
try
Blob.Seek(0, soFromBeginning);
fs := TFileStream.Create(St[8], fmOpenRead or fmShareDenyWrite);
try
Blob.CopyFrom(fs, fs.Size);
finally
fs.Free;
end;
finally
Blob.Free;
end;
end;

it gives error "invalid typecast" at runtime
when below line executes
Blob := DSTemp.CreateBlobStream(DSTemp.FieldByName('EkFile '), bmWrite);

when i change Blob: TBlobStream
it gives error : Incompatible types TBlobStream and TStream

why ?

also
EkFile -> varbinary -> 50
what is 50 for max filesize ? 50 byte ?

thanx

MeCeX