How to insert and read image from database (sql server) using MFC ?
How to insert and read images to/from database (sql server) using MFC ?
an example or a reference would be appreciated :)
Re: How to insert and read image from database (sql server) using MFC ?
Any image is just a number of bytes from database standpoint. So, to store images, your database column must be of some binary type, the size enough to store any possible image size.
Using CLongBinary for BLOBs
Re: How to insert and read image from database (sql server) using MFC ?
Or use the CByteArray class...
Re: How to insert and read image from database (sql server) using MFC ?
Thanks for the reply :) .
I did use Image , Istreams, and bytes class.
This source helped a lot .
http://www.codeproject.com/Articles/...y-show-picture
Re: How to insert and read image from database (sql server) using MFC ?
Quote:
Originally Posted by
Artista
What does that project have to do with your question?
Re: How to insert and read image from database (sql server) using MFC ?
Quote:
Originally Posted by
GCDEF
What does that project have to do with your question?
Download the demo and check the code.
Actually my real problem was reading the picture then write it to an array of bytes so I used
"while(cFileStream.Read(array, size)"
.. And also loading the image I had did transfere bytes to an Istream obj. then using the Image class I loaded it easily.