Private Sub FillCLV
Dim defaultImage As Bitmap
defaultImage.Initialize(File.DirAssets,"ditl.jpg")
Private ResultSet1 As ResultSet
Private Query As String
Query = "SELECT ID, Fish, date, location, image FROM fishcaught"
ResultSet1 = Starter.SQL1.ExecQuery(Query)
Do While ResultSet1.NextRow
Private bmp As Bitmap
If ResultSet1.GetBlob2(4) = Null Then
bmp = defaultImage
Else
Private Buffer() As Byte 'declare an empty byte array
Buffer = ResultSet1.GetBlob2(4)
Private InputStream1 As InputStream
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
Private bmp As Bitmap
bmp.Initialize2(InputStream1)
InputStream1.Close
End If
CLV1.Add(CreateItem(CLV1.AsView.Width, ResultSet1.GetString2(0), ResultSet1.GetString2(1), ResultSet1.GetString2(2), ResultSet1.GetString2(3), bmp), ResultSet1.GetString2(0))
Loop
ResultSet1.Close
End Sub