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. How to display Image in grid view ?

How to display Image in grid view ?

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasequestioncssasp-net
8 Posts 4 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.
  • C Offline
    C Offline
    cocoonwls
    wrote on last edited by
    #1

    Dear all, I am using VS2005, asp.net with c# and sql server2005. I am storing my picture path in database. Can anyone suggest me how can i display the picture according to the picture path in database into a gridview? In my case,the grid view will show name and description then the last field will be the image. Any opinion or suggestion are welcom. regards cocoonwls

    S A 3 Replies Last reply
    0
    • C cocoonwls

      Dear all, I am using VS2005, asp.net with c# and sql server2005. I am storing my picture path in database. Can anyone suggest me how can i display the picture according to the picture path in database into a gridview? In my case,the grid view will show name and description then the last field will be the image. Any opinion or suggestion are welcom. regards cocoonwls

      S Offline
      S Offline
      SayreCC
      wrote on last edited by
      #2

      Hi, you can Add in your grid a image field. then this imagefield have properties to call the image from your database. like: DataImageUrlField = dr("image").tostring(); Hope this one Can Help Thanks

      C 1 Reply Last reply
      0
      • S SayreCC

        Hi, you can Add in your grid a image field. then this imagefield have properties to call the image from your database. like: DataImageUrlField = dr("image").tostring(); Hope this one Can Help Thanks

        C Offline
        C Offline
        cocoonwls
        wrote on last edited by
        #3

        Hi sayrecollado, thanks for your quick reply. But may i know where to add the DataImageUrlFiled? regards cocoonwls

        K 1 Reply Last reply
        0
        • C cocoonwls

          Hi sayrecollado, thanks for your quick reply. But may i know where to add the DataImageUrlFiled? regards cocoonwls

          K Offline
          K Offline
          Kaushal Arora
          wrote on last edited by
          #4

          Add the tag in the Gridview like this.<asp:GridView> <Columns> <asp:imagefield dataimageurlfield='<%# DataBinder.Eval(Container.DataItem, "imagepath") %>'/> </columns> </asp:GridView>
          Where imagepath is the Column of the Dataset having image path. This will automatically display the image when you will bind the dataset to gridview. Regards, Kaushal Arora

          C 1 Reply Last reply
          0
          • C cocoonwls

            Dear all, I am using VS2005, asp.net with c# and sql server2005. I am storing my picture path in database. Can anyone suggest me how can i display the picture according to the picture path in database into a gridview? In my case,the grid view will show name and description then the last field will be the image. Any opinion or suggestion are welcom. regards cocoonwls

            S Offline
            S Offline
            SayreCC
            wrote on last edited by
            #5

            Hi, DataImageUrlField from your Grid properties Like this: ImgURL field from your database tablename.columnfield

            1 Reply Last reply
            0
            • K Kaushal Arora

              Add the tag in the Gridview like this.<asp:GridView> <Columns> <asp:imagefield dataimageurlfield='<%# DataBinder.Eval(Container.DataItem, "imagepath") %>'/> </columns> </asp:GridView>
              Where imagepath is the Column of the Dataset having image path. This will automatically display the image when you will bind the dataset to gridview. Regards, Kaushal Arora

              C Offline
              C Offline
              cocoonwls
              wrote on last edited by
              #6

              Hi, thanks I will try it and come back to you:) regards cocoonwls

              1 Reply Last reply
              0
              • C cocoonwls

                Dear all, I am using VS2005, asp.net with c# and sql server2005. I am storing my picture path in database. Can anyone suggest me how can i display the picture according to the picture path in database into a gridview? In my case,the grid view will show name and description then the last field will be the image. Any opinion or suggestion are welcom. regards cocoonwls

                A Offline
                A Offline
                Abhijit Jana
                wrote on last edited by
                #7

                cocoonwls wrote:

                I am using VS2005, asp.net with c# and sql server2005. I am storing my picture path in database. Can anyone suggest me how can i display the picture according to the picture path in database into a gridview?

                Yes! Displaying Image in Gridview from Database

                cheers, Abhijit CodeProject MVP

                C 1 Reply Last reply
                0
                • A Abhijit Jana

                  cocoonwls wrote:

                  I am using VS2005, asp.net with c# and sql server2005. I am storing my picture path in database. Can anyone suggest me how can i display the picture according to the picture path in database into a gridview?

                  Yes! Displaying Image in Gridview from Database

                  cheers, Abhijit CodeProject MVP

                  C Offline
                  C Offline
                  cocoonwls
                  wrote on last edited by
                  #8

                  Hi Abhijit, That is a great article for a newbie in asp.net like me. But my image are located in C:\myFolder, so how can i display it from there? the path which i store in database is "C:\myFolder\img.gif". I saw in your article you always have the symbol "~", could you tell me why is like that? thanks in advance, and thanks for those reply me question~ regards cocoonwls

                  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