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. General Programming
  3. Visual Basic
  4. How to save & retrieve photos in a database

How to save & retrieve photos in a database

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

    JOY Hai,:laugh: I am working on a student database project in Vb.net. I have established a connection betwen Ms-Access table & my form through DATASET. Now i am able to save & retrive the records. what i want is to store the photograph of students. if i am not wrong, we can use imagelist so that the photos can be displayed.but how to connect it from the access table . My second question is to know how to store & retrive the photos.so that whenever i move to a particular student's record ,his photo should appear.Can u pl help me with an example for a clear understanding if photos cannot be stored in a databae then what could be an alternative to this. pl exlain briefly if so. Arun :)

    K V M 3 Replies Last reply
    0
    • A Arun Hegde

      JOY Hai,:laugh: I am working on a student database project in Vb.net. I have established a connection betwen Ms-Access table & my form through DATASET. Now i am able to save & retrive the records. what i want is to store the photograph of students. if i am not wrong, we can use imagelist so that the photos can be displayed.but how to connect it from the access table . My second question is to know how to store & retrive the photos.so that whenever i move to a particular student's record ,his photo should appear.Can u pl help me with an example for a clear understanding if photos cannot be stored in a databae then what could be an alternative to this. pl exlain briefly if so. Arun :)

      K Offline
      K Offline
      kayos592
      wrote on last edited by
      #2

      In the past I would usually store the image NAME (ie. in a "Image_PathFileName" field. This way when I run through my recordsets I can retrieve the image by pulling the Image_PathFileName value and plugging it into my code..... -Kay

      1 Reply Last reply
      0
      • A Arun Hegde

        JOY Hai,:laugh: I am working on a student database project in Vb.net. I have established a connection betwen Ms-Access table & my form through DATASET. Now i am able to save & retrive the records. what i want is to store the photograph of students. if i am not wrong, we can use imagelist so that the photos can be displayed.but how to connect it from the access table . My second question is to know how to store & retrive the photos.so that whenever i move to a particular student's record ,his photo should appear.Can u pl help me with an example for a clear understanding if photos cannot be stored in a databae then what could be an alternative to this. pl exlain briefly if so. Arun :)

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        Arun, You can store images in MsAccess. I think you can use Ole Object datatype for that. If you check out ASp.net website TimeTracker starterkit using Microsoft Access, you can see this implementation. Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://www.dotnetjunkies.com/weblog/deepak/
        http://deepakvasudevan.blogspot.com/
        http://deepak.blogdrive.com/

        1 Reply Last reply
        0
        • A Arun Hegde

          JOY Hai,:laugh: I am working on a student database project in Vb.net. I have established a connection betwen Ms-Access table & my form through DATASET. Now i am able to save & retrive the records. what i want is to store the photograph of students. if i am not wrong, we can use imagelist so that the photos can be displayed.but how to connect it from the access table . My second question is to know how to store & retrive the photos.so that whenever i move to a particular student's record ,his photo should appear.Can u pl help me with an example for a clear understanding if photos cannot be stored in a databae then what could be an alternative to this. pl exlain briefly if so. Arun :)

          M Offline
          M Offline
          Madni Abbasi
          wrote on last edited by
          #4

          You can use as folllowing 1- get the path using Open file dialogue in text box as I taken in txtCompanyLogo.text 2- Dim arr() As Byte If Trim(txtCompanyLogo.Text) <> "" Then FileOpen(1, txtCompanyLogo.Text, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared) 'Resize array so that it can accomodate the file ReDim arr(FileLen(txtCompanyLogo.Text) - 1) FileGet(1, arr) FileClose(1) '/////// Ds is DataSet & CompanyInfo is TableName & CompanyLogo is Field Name for Binary Data //////////// ds.Tables("CompanyInfo").Rows(0).Item("CompanyLogo") = arr End If Enjoy Solution

          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