Question : How to save images and image file paths into SQL from delphi form

I have a form that users enter records into called a 'Custom App' record. Each Custom App record can have an image (.jpg) file associated with it.
What is the best way to do this and be able to retrieve it when opening up the form? I am using DevExpress Grids and currently, my form is using tcxImage to show a picture IF the picture's file path is already saved into SQL record. I can't figure out how to save the file path of a NEW picture I load into tcxImage into SQL.
Thanks!

Answer : How to save images and image file paths into SQL from delphi form

call post method of dataset after assigning file path:

procedure TForm1.cxImage1PropertiesCustomClick(Sender: TObject);
begin
     if OpenPictureDialog1.Execute then
     begin
           YourDataSet.FieldByName('PicPath').AsString:= OpenPictureDialog1.FileName;
           YourDataSet.Post;
           cxImage1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
   end;
end
Random Solutions  
 
programming4us programming4us