• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

visual basic.net 2005 front end and access 2007 as backend , need help with storing images

I would like to know if it is possible to insert an image (jpeg, bitmap) next to the path that already exists in access database and be able to see the image along with the path within the datagridview in visual basic 2005 run time?
Please let me know
0
systems_ax
Asked:
systems_ax
  • 4
  • 2
1 Solution
 
vs1784Commented:
You want to insert image path and image as binary data in same column?
0
 
systems_axAuthor Commented:
This is what I have:
2 columns in access 2007:

Path to the file:                        Name of report that shows
Files\Building1.doc                   Building1

I am able to retrieve the name of the file and open it VIA the datagridview in vb.net 2005 but I also need to display an image under the same column as the file's name on the datagridview.

Please let me know how I can do this.
0
 
vs1784Commented:
Below is sample code i found for that. Check it should help you show images in datagridview
Dim myIcon As New Icon("..\Images\Icon1.ico") 
        Dim ImgCell = New DataGridViewImageCell(True)
        Dim ImgColumn1 As New DataGridViewImageColumn
        Dim ImgColumn2 As New DataGridViewImageColumn
 
        ImgColumn1.CellTemplate = ImgCell
        ImgColumn2.CellTemplate = ImgCell
 
        Me.DataGridView1.Columns.Add(ImgColumn1)
        Me.DataGridView1.Columns.Add(ImgColumn2)
 
        Dim dg As DataGridViewRow
        Dim dc As DataGridViewImageCell
 
        For Each dg In DataGridView1.Rows
 
            For Each dc In dg.Cells
 
                dc.Value = myIcon
 
            Next
 
        Next

Open in new window

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
systems_axAuthor Commented:
hi vs1784,
can you please explain what the code means line by line.  Do I create an access row for images or do I do it ONLY via code in visual basic?
thank you
0
 
systems_axAuthor Commented:
hi vs1784,
Unfortunately, I do not need an additional image column, I need to have an image right next to the text under 1 column.
thank you
0
 
systems_axAuthor Commented:
can you helpo in storing an image under 1 column with text also?
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now