I have created an image column in my datagridview and want to populate the grid based on the result of a database query. I'm able to pull the data from the database and populate the fields fine, but the image column where I want to display the image shows a broken image, this is the code I'm using:
Dim thispri As Bitmap
Do
While SQLdr.Read()
'Build Grid Data
If (SQLdr("priority") = "high") Then
thispri = New Bitmap("C:\VB...\hpri.bmp")
ElseIf (SQLdr("priority") = "medium") Then
thispri = New Bitmap("C:\VB...\mpri.bmp")
ElseIf (SQLdr("priority") = "low") Then
thispri = New Bitmap("C:\VB...\lpri.bmp")
End If
mainData.Rows.Add(...)
End While
I'm using the full path to the images, shortened here because of longtail location.