Topic: Retrieve image from database and put into gridview column

Hello Dmitry,

Do you have any sample code for retrieving an image from a database and saving it to disk so it can be loaded into a gridview?

Thanks!

MAK

Re: Retrieve image from database and put into gridview column

Master Dmitry, Post : Picture in a grid

link http://myvisualdatabase.com/forum/viewtopic.php?id=1235
Download Grid With Image http://myvisualdatabase.com/forum/misc. … download=1

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: Retrieve image from database and put into gridview column

Thanks for your post prahousefamily, but that's not what I want to do.

I need to retrieve an image from a database (storedfile) and save it to disk.

Thanks!

MAK

Re: Retrieve image from database and put into gridview column

Hello,


An example, how to save file to disk

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
   s: string;
begin
     s := SaveFileFromDataBase('tablename', 'fieldname', Form1.TableGrid1.dbItemID); // save file to disk and get filename in system temp folder
     OpenFile(s); // open file
     CopyFile(s, 'd:\'+ExtractFileName(s)); // copy the file to disk d:\
end;
Dmitry.

Re: Retrieve image from database and put into gridview column

Thanks Dmitry!

That's exactly what I was looking for.

MAK