Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert & Read image in SQL Server

Status
Not open for further replies.

Qamar Zaman

Programmer
Aug 9, 2019
7
PK
Hello experts,

i am using front end VFP9 and back end SQL Server 2014.

1. how to insert or update image file in sql server table. which type use in sql server table for image.

2. how to read or show image file on vfp form.


Thanks in advance
Qamar Zaman

 
The file could be stored in a varbinary(MAX) field.

To get it in there, you would need a parameter for the SQL call - you can't put the contents of a file into a string comfortably - that would look a bit like this:

Code:
Update tblMyTable Set FileName=@FileName, ImageFile=@ImageFile where ID = myID;

You would probably want to store the original file name or at least the file type along with the actual file so you know what it is later.

You could usefully explore this thread, Olaf has made a good contribution to it.

thread184-1675028

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Right Griff

Thank your so much ...

Regards,
Qamar Zaman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top