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. General Programming
  3. Visual Basic
  4. Save a Blank Picture box to database

Save a Blank Picture box to database

Scheduled Pinned Locked Moved Visual Basic
databasehelp
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.
  • A Offline
    A Offline
    aransiola
    wrote on last edited by
    #1

    i have a windowform with employee image, Firstname and other data. I can save the image of the employee(when loaded into the image control) but when i dont load the picture in the image control it flags error t.aransiola

    D 1 Reply Last reply
    0
    • A aransiola

      i have a windowform with employee image, Firstname and other data. I can save the image of the employee(when loaded into the image control) but when i dont load the picture in the image control it flags error t.aransiola

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      And the error would be ...??? What about the code that's throwing it?? You only use a PictureBox to show an image, not to store it. And I'm not real thrilled with the idea of even using a PictureBox in most cases. You do NOT do something like this:

      PictureBox1.Image.Save...
      

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      T 1 Reply Last reply
      0
      • D Dave Kreskowiak

        And the error would be ...??? What about the code that's throwing it?? You only use a PictureBox to show an image, not to store it. And I'm not real thrilled with the idea of even using a PictureBox in most cases. You do NOT do something like this:

        PictureBox1.Image.Save...
        

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        T Offline
        T Offline
        Teddy32
        wrote on last edited by
        #3

        instead of saving a blank picture box why not save a default image such as the company logo or such like. you can trap the error then load the default picture on this error.

        A 1 Reply Last reply
        0
        • T Teddy32

          instead of saving a blank picture box why not save a default image such as the company logo or such like. you can trap the error then load the default picture on this error.

          A Offline
          A Offline
          aransiola
          wrote on last edited by
          #4

          Iwant the Image Field remain Null for those that doesnt have picture. saving a default image in the database will impact the db thanks t.aransiola

          D 1 Reply Last reply
          0
          • A aransiola

            Iwant the Image Field remain Null for those that doesnt have picture. saving a default image in the database will impact the db thanks t.aransiola

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            The picturebox should be there to show a picture, not to store one. If the database doesn't have a picture, you can either choose set the PictureBox's Image property to Nothing, or you can show a blank image or silohette image. It appears you already have a picture in an Image object. After all, you have to set the PictureBox's image property to it so it shows up. So, you can save the image data to your database from the original image object, without using any of the properties of the PictureBox.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            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