944,123 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 13199
  • VB.NET RSS
Nov 3rd, 2007
0

Insert image into datagridview

Expand Post »
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:
vb Syntax (Toggle Plain Text)
  1. Dim thispri As Bitmap
  2.  
  3. Do
  4. While SQLdr.Read()
  5. 'Build Grid Data
  6. If (SQLdr("priority") = "high") Then
  7. thispri = New Bitmap("C:\VB...\hpri.bmp")
  8. ElseIf (SQLdr("priority") = "medium") Then
  9. thispri = New Bitmap("C:\VB...\mpri.bmp")
  10. ElseIf (SQLdr("priority") = "low") Then
  11. thispri = New Bitmap("C:\VB...\lpri.bmp")
  12.  
  13. End If
  14. mainData.Rows.Add(...)
  15.  
  16.  
  17. End While

I'm using the full path to the images, shortened here because of longtail location.
Similar Threads
Reputation Points: 10
Solved Threads: 2
Light Poster
StatiX is offline Offline
32 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Returning a Generic List
Next Thread in VB.NET Forum Timeline: limit forms open through MDI to 1





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC