SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Retrieving images from access database

    Retrieving images from access database:

    I stored path of the images in access database. I am trying to display on my web page using gridview.

    My select statement is:
    select albumname,albumpic from albums.
    Hyperlink is working fine, but not displaying image.Please help.

    Here is the code.

    <asp:TemplateField>

    <ItemTemplate>
    <asp:HyperLink ID="HyperLink1" NavigateUrl='<%#

    Eval("albumname","album.aspx?albumname={0}") %>' runat="server">
    <asp:Image ID="Image1" runat="server" ImageUrl='<%#

    Eval("albumpic") %>' />
    </asp:HyperLink>
    </ItemTemplate>

    </asp:TemplateField>

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You are still dealing with a html image tag here. Meaning you need to create a http handler to stream the image out of the database with the appropriate content-type. You then set your HyperLink to get the image from the image handler.

    Side note: Access does very badly storing binaries. Very, very bady. And that is on the desktop. For a web-facing application, you could see alot of scalability and database corruption issues.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •