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. Problem inserting image into table!

Problem inserting image into table!

Scheduled Pinned Locked Moved ASP.NET
questiondatabasehelp
5 Posts 4 Posters 1 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.
  • B Offline
    B Offline
    Branislav Vidovic
    wrote on last edited by
    #1

    Hy guys, I have a question about images in SQL databses. When I am in database table viewer in Microsoft Visual Web Developer 2005 Express Edition and I am entering data into the table, how do I insert image into the image-type field? What are the pre-conditions for inserting a picture (which is on my hard drive) to image-type field in database? Thank you for your time. Cheers

    C N M 3 Replies Last reply
    0
    • B Branislav Vidovic

      Hy guys, I have a question about images in SQL databses. When I am in database table viewer in Microsoft Visual Web Developer 2005 Express Edition and I am entering data into the table, how do I insert image into the image-type field? What are the pre-conditions for inserting a picture (which is on my hard drive) to image-type field in database? Thank you for your time. Cheers

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

      I am not sure if that's what the image type is for, because your DB will have no idea if the byte array you pass it is a bitmap. Have you googled for info ? I would suggest the best bet is to store the image in the file system, and store paths in your DB, but there's no reason you can't store the image data in your DB.

      Christian Graus - Microsoft MVP - C++ "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 )

      B 1 Reply Last reply
      0
      • B Branislav Vidovic

        Hy guys, I have a question about images in SQL databses. When I am in database table viewer in Microsoft Visual Web Developer 2005 Express Edition and I am entering data into the table, how do I insert image into the image-type field? What are the pre-conditions for inserting a picture (which is on my hard drive) to image-type field in database? Thank you for your time. Cheers

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        A C# Windows application to store and retrieve photos from a SQL Server database. http://www.codeproject.com/KB/database/albumviewer.aspx[^]


        only two letters away from being an asset

        1 Reply Last reply
        0
        • B Branislav Vidovic

          Hy guys, I have a question about images in SQL databses. When I am in database table viewer in Microsoft Visual Web Developer 2005 Express Edition and I am entering data into the table, how do I insert image into the image-type field? What are the pre-conditions for inserting a picture (which is on my hard drive) to image-type field in database? Thank you for your time. Cheers

          M Offline
          M Offline
          Mitesh Darji
          wrote on last edited by
          #4

          Convert image in to binary data and store into the database. and whenever you want to access the image from the database, read binary data from the database and create .bmp file :)

          mitesh

          1 Reply Last reply
          0
          • C Christian Graus

            I am not sure if that's what the image type is for, because your DB will have no idea if the byte array you pass it is a bitmap. Have you googled for info ? I would suggest the best bet is to store the image in the file system, and store paths in your DB, but there's no reason you can't store the image data in your DB.

            Christian Graus - Microsoft MVP - C++ "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 )

            B Offline
            B Offline
            Branislav Vidovic
            wrote on last edited by
            #5

            And what about the Gridview control. I know I can use it to display data from database very easy. And if the table in the database contains images will the gridview control display it automaticly as it does for the other fields?

            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