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. Urgent question on displaying Binary IMAGE data to a Datagrid in C# ASP.NET

Urgent question on displaying Binary IMAGE data to a Datagrid in C# ASP.NET

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasequestionhtmlasp-net
8 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.
  • I Offline
    I Offline
    Infernojericho
    wrote on last edited by
    #1

    Hi, I have a VERY URGENT question on C# in ASP.NET. I am building an ASP.NET WEB application. Does anyone know how to retreive BINARY image from a SQL Server 2005 Express Database and DISPLAY it on a Datagrid control? I can manage to retreive the Binary Data, but I have absolutely no idea how it can be placed into the dataset, or accessed via the Databinder. I can only display regular string data onto a Datagrid Control. This is my method in displaying string data onto a Datagrid: 1. From the Codebehind, I connect to the database. 2. I then use a DATASET and store the retreived data 3. In the HTML page, I use the Databinder to load the data (<%# DataBinder.Eval(Container.DataItem,"NAMEOFDATABASECOLUMN") %> However this method only works for strings, I need to display Binary Image, can anyone help me? Thank you!!!

    C 1 Reply Last reply
    0
    • I Infernojericho

      Hi, I have a VERY URGENT question on C# in ASP.NET. I am building an ASP.NET WEB application. Does anyone know how to retreive BINARY image from a SQL Server 2005 Express Database and DISPLAY it on a Datagrid control? I can manage to retreive the Binary Data, but I have absolutely no idea how it can be placed into the dataset, or accessed via the Databinder. I can only display regular string data onto a Datagrid Control. This is my method in displaying string data onto a Datagrid: 1. From the Codebehind, I connect to the database. 2. I then use a DATASET and store the retreived data 3. In the HTML page, I use the Databinder to load the data (<%# DataBinder.Eval(Container.DataItem,"NAMEOFDATABASECOLUMN") %> However this method only works for strings, I need to display Binary Image, can anyone help me? Thank you!!!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Infernojericho wrote:

      I have a VERY URGENT question

      So, totally different from all the others ?

      Infernojericho wrote:

      Does anyone know how to retreive BINARY image from a SQL Server 2005 Express Database and DISPLAY it on a Datagrid control?

      Yes, you need to write a http handler, and have your images link through that. your problem is that an img tag requires a link to the image itself. So, you need to write a http handler that returns that image data, and then your databinding creates the link that that page, with an id that is used to seperately download the image. This means a lot of database hits, a better bet for a high load site is to put the images on your file system and store the path to them in yuor database.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      I 1 Reply Last reply
      0
      • C Christian Graus

        Infernojericho wrote:

        I have a VERY URGENT question

        So, totally different from all the others ?

        Infernojericho wrote:

        Does anyone know how to retreive BINARY image from a SQL Server 2005 Express Database and DISPLAY it on a Datagrid control?

        Yes, you need to write a http handler, and have your images link through that. your problem is that an img tag requires a link to the image itself. So, you need to write a http handler that returns that image data, and then your databinding creates the link that that page, with an id that is used to seperately download the image. This means a lot of database hits, a better bet for a high load site is to put the images on your file system and store the path to them in yuor database.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        I Offline
        I Offline
        Infernojericho
        wrote on last edited by
        #3

        Hi Christian, thanks for your reply (again). I am afraid I am not very good in ASP.NET (I think you can tell that already), and I am quite lost. Do you happen to know any sites on the web with similar examples? Many thanks again.

        C 1 Reply Last reply
        0
        • I Infernojericho

          Hi Christian, thanks for your reply (again). I am afraid I am not very good in ASP.NET (I think you can tell that already), and I am quite lost. Do you happen to know any sites on the web with similar examples? Many thanks again.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          I think this[^] does what I mean.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          I 2 Replies Last reply
          0
          • C Christian Graus

            I think this[^] does what I mean.

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            I Offline
            I Offline
            Infernojericho
            wrote on last edited by
            #5

            Thanks, Christian. Greatly appreciated. I'll take a look at it right now.

            1 Reply Last reply
            0
            • C Christian Graus

              I think this[^] does what I mean.

              Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              I Offline
              I Offline
              Infernojericho
              wrote on last edited by
              #6

              Sorry, but one last thing, I see that the example you provided is using VS.NET 2005, should I be worried if I am using VS.NET 2003? Thanks!!!

              C 1 Reply Last reply
              0
              • I Infernojericho

                Sorry, but one last thing, I see that the example you provided is using VS.NET 2005, should I be worried if I am using VS.NET 2003? Thanks!!!

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                That would mean that you can't use the project provided, but the overall concept will be the same.

                Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                I 1 Reply Last reply
                0
                • C Christian Graus

                  That would mean that you can't use the project provided, but the overall concept will be the same.

                  Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                  I Offline
                  I Offline
                  Infernojericho
                  wrote on last edited by
                  #8

                  Alright, many thanks again for the assist.

                  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