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. showing an image which has been saved in SQL server

showing an image which has been saved in SQL server

Scheduled Pinned Locked Moved ASP.NET
databasehelpsql-serversysadmin
6 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.
  • M Offline
    M Offline
    MasudM
    wrote on last edited by
    #1

    Hi I have problem to how could I show an image file which has been saved in db in my pages. I mean I have an image file that has been saved in db and I want to load it in my page. I search articles and I found nothing ! I appreciate your help Regrads

    S C 2 Replies Last reply
    0
    • M MasudM

      Hi I have problem to how could I show an image file which has been saved in db in my pages. I mean I have an image file that has been saved in db and I want to load it in my page. I search articles and I found nothing ! I appreciate your help Regrads

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

      this may not be the best solution but.... Store the Imge path in the DB, and do a Response.Write("![](+path+)"); _____________________________________________________ Yea! I could be wrong...

      1 Reply Last reply
      0
      • M MasudM

        Hi I have problem to how could I show an image file which has been saved in db in my pages. I mean I have an image file that has been saved in db and I want to load it in my page. I search articles and I found nothing ! I appreciate your help Regrads

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

        Hi there, Use this link...hope it might solve your problem http://www.codeproject.com/cs/database/albumviewer.asp You can use System.IO namespace to solve your problem.

        M 1 Reply Last reply
        0
        • C codeajay

          Hi there, Use this link...hope it might solve your problem http://www.codeproject.com/cs/database/albumviewer.asp You can use System.IO namespace to solve your problem.

          M Offline
          M Offline
          MasudM
          wrote on last edited by
          #4

          Thanks But you know when I am using asp.net there was a problem that only I can use imgeurl in my asp:Image control and I can not address the Image which reside on memory. I kind I have a solution by using a proxy page but that is kind of hard. And I thing there might be a better solution like that which we use in Windows Applications Like in example : Bitmap bmp1 = new Bitmap(bmp, new Size(500,300)); pictureBox.Image = bmp1; if any other usefull urls or suggestions please tell me

          M C 2 Replies Last reply
          0
          • M MasudM

            Thanks But you know when I am using asp.net there was a problem that only I can use imgeurl in my asp:Image control and I can not address the Image which reside on memory. I kind I have a solution by using a proxy page but that is kind of hard. And I thing there might be a better solution like that which we use in Windows Applications Like in example : Bitmap bmp1 = new Bitmap(bmp, new Size(500,300)); pictureBox.Image = bmp1; if any other usefull urls or suggestions please tell me

            M Offline
            M Offline
            minhpc_bk
            wrote on last edited by
            #5

            Hi there, In this case, you simply create a seperate page, say ShowImage.aspx, which is mainly used to display the image. Then you can assign this page to the Image.ImageUrl property:

            Image1.ImageUrl = "ShowImage.aspx";

            The sample code to read the image in the ShowImage.aspx looks something like:

            private void Page_Load(object sender, System.EventArgs e)
            {
            Bitmap bmp1 = CreateBitmapInstance();

                bmp1.Save(Response.OutputStream, ImageFormat.Gif);	
                                   
            bmp1.Dispose();
            

            }

            private Bitmap CreateBitmapInstance()
            {
            //You code here to create a bitmap instance from the image data saved in DB.
            }

            1 Reply Last reply
            0
            • M MasudM

              Thanks But you know when I am using asp.net there was a problem that only I can use imgeurl in my asp:Image control and I can not address the Image which reside on memory. I kind I have a solution by using a proxy page but that is kind of hard. And I thing there might be a better solution like that which we use in Windows Applications Like in example : Bitmap bmp1 = new Bitmap(bmp, new Size(500,300)); pictureBox.Image = bmp1; if any other usefull urls or suggestions please tell me

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

              Masud the suggestion as given by minhpc_bk is the most accepted solution so far for displaying images from memory. Also, if it is not a burden on your server than you can also store the image from memory to some location on server and apply that path to the ImageUrl.

              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