954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Insert image into datagridview

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.

StatiX
Light Poster
33 posts since Aug 2006
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You