Displaying images from a MySQL Database

Discussion in 'ASP .Net' started by Matt, Aug 1, 2003.

  1. Matt

    Matt Guest

    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
     
    Matt, Aug 1, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SmltIE1hY2U=?=

    Displaying images from a database in an image control

    =?Utf-8?B?SmltIE1hY2U=?=, May 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    389
    Ashish M Bhonkiya
    May 5, 2004
  2. Blaktyger
    Replies:
    5
    Views:
    672
    Blaktyger
    Aug 16, 2004
  3. Oli Waters
    Replies:
    3
    Views:
    101
    Andy Baxter
    Jan 12, 2004
  4. Oli Waters
    Replies:
    2
    Views:
    261
    Andy Baxter
    Jan 12, 2004
  5. Stuart Weaver
    Replies:
    6
    Views:
    116
    Stuart Weaver
    Jan 17, 2004
Loading...

Share This Page