Dear All Master,
I want the image to appear in the multi picturebox (Picturebox1-Picturebox6) when clicked on the "ITC" column in the datagridview.
The image location is in the "path" column in the join with the "filename1-filename6" column.
and for those without an image, it appears in the picturebox "no photo".
I don't want to use databindings because it makes it slow and my record is fifty thousand records.
for the record i use visual studio 2010
thanksCode:Imports System.Data.OleDb Public Class Form1 Private WithEvents dt As New DataTable Dim Path As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) Dim cn = "provider=Microsoft.Jet.OLEDB.4.0; data source=" & Path & "; Extended Properties=dBase IV" Private Sub FillDataGridView() Try 'Dim dt = New DataTable() dt = New DataTable Dim query = "select ITM,ITC,QOH,PRS,FILENAME1,FILENAME2,FILENAME3,FILENAME4,FILENAME5,FILENAME6,PATH FROM ITEM" Using adapter As New OleDbDataAdapter(query, cn.ToString) adapter.Fill(dt) End Using Me.DataGridView1.DataSource = dt 'For x As Integer = 4 To 10 ' Me.DataGridView1.Columns(x).Visible = False 'Next Catch myerror As OleDbException MessageBox.Show("Error: " & myerror.Message) Finally End Try End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FillDataGridView() End Sub End Class
roy88




Reply With Quote
