Using SQLite as the datasource, works for me
Database has a Table Named "tblImages" with 2 Fields "ID" (Integer) & "ImageBlob" (Blob)
Dim imglist as New ImageList
Dim Database as string = "C:\Images.db"
Dim CommandString As String
Dim CN As New SQLite.SQLiteConnection("Data Source=" & Database & ";Version=3;")
CN.Open()
Dim cmd As New SQLiteCommand
cmd.Connection = CN
Dim Da As New SQLiteDataAdapter
Try
imglist.Images.Clear()
imglist.ColorDepth = ColorDepth.Depth32Bit
CommandString = "select * from tblImages"
Dim dt_images As New DataTable
cmd.CommandText = CommandString
Da.SelectCommand = cmd
Da.Fill(dt_images)
For Each dr As DataRow In dt_images.Rows
Dim img_buffer = CType(dr("ImageBlob"), Byte())
Dim img_stream As New MemoryStream(img_buffer, True)
img_stream.Write(img_buffer, 0, img_buffer.Length)
imglist.Images.Add(dr("ID").ToString(), New Bitmap(img_stream))
img_stream.Close()
Next
CN.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
This will load every Image from the table into a Imagelist, You can either have it declared in code or have one on your form, either will work. Just make sure if you have it declared to link it to the control using its imagelist property if that is what you are planning to do.