Sub ExecuteListViewWithBlob(SQL As SQL, Query As String, StringArgs() As String, Limit As Int, _
ListView1 As ListView, TwoLines As Boolean, BlobCol As String, ValueCol As String)
ListView1.Clear
Dim Table As Cursor, bmpMom As Bitmap
Table = SQL.ExecQuery(Query)
For i = 0 To Table.RowCount - 1
Table.Position=i
If Table.GetBlob( BlobCol) = Null Then
bmpMom.InitializeMutable (100,100)
Else
Dim Buffer() As Byte 'declare an empty byte array
Buffer = Table.GetBlob( BlobCol)
Dim InputStream1 As InputStream
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
bmpMom.Initialize2(InputStream1)
End If
If ValueCol = Null Then
ListView1.AddTwoLinesAndBitmap(Table.GetString2( 0), Table.GetString2(1), bmpMom )
Else
ListView1.AddTwoLinesAndBitmap2(Table.GetString2( 0), Table.GetString2(1), bmpMom, Table.GetString(ValueCol) )
End If
Next
End Sub