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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Display image along with the grid view

Display image along with the grid view

Scheduled Pinned Locked Moved ASP.NET
cssdatabasesql-serversysadminhelp
8 Posts 3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi All, I am working on an application where I wants to display employee details in GridView. The image of the employee is stored in SQL Server 2005 table as image field . Now I wants to display the data along with the grid so how to display this can anybody help me with code. Thanks Regards

    Sujit

    N 1 Reply Last reply
    0
    • L Lost User

      Hi All, I am working on an application where I wants to display employee details in GridView. The image of the employee is stored in SQL Server 2005 table as image field . Now I wants to display the data along with the grid so how to display this can anybody help me with code. Thanks Regards

      Sujit

      N Offline
      N Offline
      N a r e s h P a t e l
      wrote on last edited by
      #2

      Hi, First save your image to Sql Server 2005[Database] in Byte Format.And then receive it as a Byte array format at server side. NOw you have to cast this image into Stream and then into write this Stream into another UserControl. But I am suggesting you not to store Your Image into DataBase, store it into FileSystem.

      Naresh Patel

      L 1 Reply Last reply
      0
      • N N a r e s h P a t e l

        Hi, First save your image to Sql Server 2005[Database] in Byte Format.And then receive it as a Byte array format at server side. NOw you have to cast this image into Stream and then into write this Stream into another UserControl. But I am suggesting you not to store Your Image into DataBase, store it into FileSystem.

        Naresh Patel

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hello Yes You are right.But This is requirement is like that we have to store 2 images in sql server database.I have stored image in database successfully.I am facing problem in showing this image in gridview.

        Sujit

        N D 2 Replies Last reply
        0
        • L Lost User

          Hello Yes You are right.But This is requirement is like that we have to store 2 images in sql server database.I have stored image in database successfully.I am facing problem in showing this image in gridview.

          Sujit

          N Offline
          N Offline
          N a r e s h P a t e l
          wrote on last edited by
          #4

          Hi Please wait i am giving you the code for it.

          Naresh Patel

          N 1 Reply Last reply
          0
          • N N a r e s h P a t e l

            Hi Please wait i am giving you the code for it.

            Naresh Patel

            N Offline
            N Offline
            N a r e s h P a t e l
            wrote on last edited by
            #5

            Hi, Please view the atricle for Displaying And Storing Image to Database at http://www.codeproject.com/useritems/Image.asp

            Naresh Patel

            L 1 Reply Last reply
            0
            • L Lost User

              Hello Yes You are right.But This is requirement is like that we have to store 2 images in sql server database.I have stored image in database successfully.I am facing problem in showing this image in gridview.

              Sujit

              D Offline
              D Offline
              DarynRoberts
              wrote on last edited by
              #6

              Hey man. We were having the same problem. Try do this. When you store it in the database...store the full url of where the picture can be found within your project. For example...our image is stored inside a folder called "Properties" which is inside a folder called "Images" So it finally worked when we saved it in the DB field as: ~\Images\Properties\officeblock1.jpg Hope that helps peace

              Dazz

              L 1 Reply Last reply
              0
              • D DarynRoberts

                Hey man. We were having the same problem. Try do this. When you store it in the database...store the full url of where the picture can be found within your project. For example...our image is stored inside a folder called "Properties" which is inside a folder called "Images" So it finally worked when we saved it in the DB field as: ~\Images\Properties\officeblock1.jpg Hope that helps peace

                Dazz

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Yea You are right.I am generally follow yours methods.That is quite good.but i have to store this in sql server.i am trying to do this.

                Sujit

                1 Reply Last reply
                0
                • N N a r e s h P a t e l

                  Hi, Please view the atricle for Displaying And Storing Image to Database at http://www.codeproject.com/useritems/Image.asp

                  Naresh Patel

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Hello Yes yours code is good.i have already done this.only problem i am facing to displaying those images in grid view.i can easily show this in aspx page by retrieving image from sql server.

                  Sujit

                  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