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. retreiving Images From Database with image datatype pbm

retreiving Images From Database with image datatype pbm

Scheduled Pinned Locked Moved ASP.NET
databasecssquestion
5 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.
  • S Offline
    S Offline
    SreejithAchutan
    wrote on last edited by
    #1

    I have a database with some fields,along with this fields an image field with datatype image is tehre.But after saving all details into the db.the saved data will be displayed on a grid.But whn i tried to retrieve the data by selecting into a grid row the text fields are coming properly.But the image will be displayed only the first photo that i uploded.Only one image will be displayed for all the rows.What is the reason I attach the image retreival code in the rowcommand of the grid. DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString(); The Getnit() is to retriving data from the table..

    N S 2 Replies Last reply
    0
    • S SreejithAchutan

      I have a database with some fields,along with this fields an image field with datatype image is tehre.But after saving all details into the db.the saved data will be displayed on a grid.But whn i tried to retrieve the data by selecting into a grid row the text fields are coming properly.But the image will be displayed only the first photo that i uploded.Only one image will be displayed for all the rows.What is the reason I attach the image retreival code in the rowcommand of the grid. DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString(); The Getnit() is to retriving data from the table..

      N Offline
      N Offline
      Nisar Inamdar
      wrote on last edited by
      #2

      Hey you hav to use for loop for this.. Try this.......... DataTable dt = new DataTable(); dt = insunit.GetUnit(id); for(int i=0; i< dt.row.count; i++) { Img_Logo.ImageUrl = d.Rows[i]["UnitLogoPath"].ToString(); } it will be work... Bye Bye. Nisar Inamdar.:rose: Always For U

      S 1 Reply Last reply
      0
      • S SreejithAchutan

        I have a database with some fields,along with this fields an image field with datatype image is tehre.But after saving all details into the db.the saved data will be displayed on a grid.But whn i tried to retrieve the data by selecting into a grid row the text fields are coming properly.But the image will be displayed only the first photo that i uploded.Only one image will be displayed for all the rows.What is the reason I attach the image retreival code in the rowcommand of the grid. DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString(); The Getnit() is to retriving data from the table..

        S Offline
        S Offline
        Sun Rays
        wrote on last edited by
        #3

        SreejithAchutan wrote:

        DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString();

        Hey what you have done here ?? Can you try to figure out ? DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.**Rows[0]**["UnitLogoPath"].ToString(); Here you are taking only first rows value... :) Change it.. If possible bind data in RowDataBound Event of gridview. On every row find appropriate data and bind it properly.

        Thanks, Sun Rays To get something you must have to try once. My Articles

        S 1 Reply Last reply
        0
        • N Nisar Inamdar

          Hey you hav to use for loop for this.. Try this.......... DataTable dt = new DataTable(); dt = insunit.GetUnit(id); for(int i=0; i< dt.row.count; i++) { Img_Logo.ImageUrl = d.Rows[i]["UnitLogoPath"].ToString(); } it will be work... Bye Bye. Nisar Inamdar.:rose: Always For U

          S Offline
          S Offline
          SreejithAchutan
          wrote on last edited by
          #4

          Thanks for ur reply .... But the pbm occurs in saving the image.All images in the db are same.How this happens.

          1 Reply Last reply
          0
          • S Sun Rays

            SreejithAchutan wrote:

            DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString();

            Hey what you have done here ?? Can you try to figure out ? DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.**Rows[0]**["UnitLogoPath"].ToString(); Here you are taking only first rows value... :) Change it.. If possible bind data in RowDataBound Event of gridview. On every row find appropriate data and bind it properly.

            Thanks, Sun Rays To get something you must have to try once. My Articles

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

            The pbm occurs is not in the rows.But the image saved is same in the db.Why the image saved is same in the db....

            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