Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Display Image from DataBase

Display Image from DataBase

Scheduled Pinned Locked Moved ASP.NET
databasecsharpsql-servervisual-studiosysadmin
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Armando_Ramirez
    wrote on last edited by
    #1

    Hi I'm actually developing a very simple WebForm in Visual Studio 2005 usign Web Developer. I have a table in SQL SERVER 2000 and Im trying to put the info into a GridView, When I tray to get the data from the columns "Name" and "Photo" from the SQL TABLE the GridView only displays the name and in the Photo Column displays a message like this: "System.Byte[]" instead of displaying the photo. CAN SOMEBODY HELP ME WITH THIS???? THANX Armando Ramírez Monterrey, MEXICO

    E 1 Reply Last reply
    0
    • A Armando_Ramirez

      Hi I'm actually developing a very simple WebForm in Visual Studio 2005 usign Web Developer. I have a table in SQL SERVER 2000 and Im trying to put the info into a GridView, When I tray to get the data from the columns "Name" and "Photo" from the SQL TABLE the GridView only displays the name and in the Photo Column displays a message like this: "System.Byte[]" instead of displaying the photo. CAN SOMEBODY HELP ME WITH THIS???? THANX Armando Ramírez Monterrey, MEXICO

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      hi there, You have to read the image from DB as binary stream and then stream it to browser. I'm pretty sure there are a lot of articles on this site Below is just one of them. ImageBinaryStream But for me, you should save image as physical file on hard disk and just store the path in SQL. This way is easier and faster, I think << >>

      A 1 Reply Last reply
      0
      • E enjoycrack

        hi there, You have to read the image from DB as binary stream and then stream it to browser. I'm pretty sure there are a lot of articles on this site Below is just one of them. ImageBinaryStream But for me, you should save image as physical file on hard disk and just store the path in SQL. This way is easier and faster, I think << >>

        A Offline
        A Offline
        Armando_Ramirez
        wrote on last edited by
        #3

        Hey thanx ¡¡ sorry but eehm ...how do I store the path in SQL ??¡¡

        E 1 Reply Last reply
        0
        • A Armando_Ramirez

          Hey thanx ¡¡ sorry but eehm ...how do I store the path in SQL ??¡¡

          E Offline
          E Offline
          enjoycrack
          wrote on last edited by
          #4

          hi there,

          Armando_Ramirez wrote:

          how do I store the path in SQL ??¡¡

          I mean that path where u store images (e.g: there is an image stored at images\pic01.jpg, so u will store the string "images\pic01.jpg" into DB) << >>

          A 1 Reply Last reply
          0
          • E enjoycrack

            hi there,

            Armando_Ramirez wrote:

            how do I store the path in SQL ??¡¡

            I mean that path where u store images (e.g: there is an image stored at images\pic01.jpg, so u will store the string "images\pic01.jpg" into DB) << >>

            A Offline
            A Offline
            Armando_Ramirez
            wrote on last edited by
            #5

            OOH RIGHT ¡¡¡ It really works this way... I saved my pictures in my server and wrote the path in the SQL TABLE COLUMN ...i still prefer to retrieve the picture and its name saved in the table 'cause I have allready developed an application for upload images to a SQL DB and I wish to use it THANX FOR UR TIME ¡¡¡

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups