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. Advertisements

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. Charlie
    Replies:
    1
    Views:
    472
    =?Utf-8?B?c3Rrb2g=?=
    Dec 22, 2004
  2. John M
    Replies:
    1
    Views:
    1,635
    Kumar Reddi
    May 29, 2005
  3. Vonnie
    Replies:
    4
    Views:
    1,694
    Steve C. Orr [MVP, MCSD]
    Sep 14, 2005
  4. Anitha
    Replies:
    2
    Views:
    2,252
    =?Utf-8?B?Qg==?=
    Dec 23, 2005
  5. =?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,836
    S. Justin Gengo
    Jul 12, 2006
  6. Blaktyger
    Replies:
    5
    Views:
    843
    Blaktyger
    Aug 16, 2004
  7. ecoolone
    Replies:
    0
    Views:
    945
    ecoolone
    Jan 3, 2008
  8. shmendrick

    Display images from SQL server database

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