how to Save Files to data base

after open file dialog how could i save this file to DB

openDialog := TOpenDialog.Create(self);
  openDialog.InitialDir := 'D:\';
 openDialog.Options := [ofFileMustExist];
//
//  // Allow only .dpr and .pas files to be selected
 openDialog.Filter :=
   'All files (*.*)|*.*';
//  // Display the open file dialog
 if openDialog.Execute  then
 title:=openDialog.FileName;
  TFileStream.Create (title, fmOpenRead);
  dbAttach_Title.Value:=title;
  //'File : '+openDialog.FileName;
//  else ShowMessage('Open file was cancelled');
ahmed hakeemAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert GOracle dbaCommented:
1: depends on the database type
2: you want to save the contents ...

use a blobstream
https://edn.embarcadero.com/article/27462

another sample:
http://www.scalabium.com/faq/dct0141.htm
1
ahmed hakeemAuthor Commented:
thank you,
but I used Varbinary(max) in sql
so I solved it as follow:
 fStream:=TFileStream.Create(OpenDialog.FileName,fmOpenRead);
    db.Edit;
     dbAttachment.LoadFromStream(fStream);
     Attachment_Title_Label.Caption:=ExtractFileName(OpenDialog.FileName);
       fStream.Free;
0
Sinisa VukSoftware architectCommented:
if you solve it ... can you close the question?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.