Displaying images from a MySQL Database

M

Matt

Hi

I'm have difficulty displaying images that are stored in a MySQL database.
I've tried using the odbc.net provider, the ByteFX provider and the
MySQLDriverCS one but can't seem to get the image to display on the screen.

I've tried searching on the net but can only find examples on how to do it
on SQL Server and havent had any luck converting them to work with MySQL.

I thought I had to put the data into a byte variable then use
Response.BinaryWrite to output it onto the screen like this:

byte tB;

tB = reader.GetByte(0);

Response.ContentType = "text/jpg";

//Response.BinaryWrite (myData.);

Response.BinaryWrite(tB);

but that doesn't seem to work. Can anyone point me in the right direction
or give me an example of how to do this.

Thanks

Matt Cartwright
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top