Display SQL stored images on an aspx

Discussion in 'ASP .Net Web Controls' started by Adam, Jul 2, 2003.

  1. Adam

    Adam Guest

    I've seen this topic in a bunch of place, but none of them seemed to
    suit my needs. I have images stored in SQL as an Image type. At any
    given point in my code there is a datatable, xImages, which has a
    field called ImageFile. The ImageFile contains the binary data for
    the jpeg.

    Here is my code to try and display the image

    Response.ContentType = "image/jpeg"
    Response.BinaryWrite(objDS.Tables("xImages").Rows(0).Item("ImageFile"))

    All I get on my aspx is the standard "red x" meaning the image is not
    found.

    Any thoughts?

    Adam
     
    Adam, Jul 2, 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. William \(Bill\) Vaughn
    Replies:
    0
    Views:
    451
    William \(Bill\) Vaughn
    Aug 21, 2003
  2. John M
    Replies:
    1
    Views:
    1,192
    Kumar Reddi
    May 29, 2005
  3. Vonnie
    Replies:
    4
    Views:
    1,596
    Steve C. Orr [MVP, MCSD]
    Sep 14, 2005
  4. =?Utf-8?B?U2lycGxheWE=?=

    Retrieving Images stored in SQL Server 2005

    =?Utf-8?B?U2lycGxheWE=?=, Jul 8, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    2,635
    S. Justin Gengo
    Jul 12, 2006
  5. shmendrick

    Display images from SQL server database

    shmendrick, Sep 23, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    104
    shmendrick
    Sep 23, 2004
Loading...

Share This Page