#Region "Data Test" Dim aidlink As String Const CONNECTION_STR As String = "Data Source=a2w;Version=3;" Private Sub ReadData() Dim objConn As SQLiteConnection Dim objCommand As SQLiteCommand Dim objReader As SQLiteDataReader Try objConn = New SQLiteConnection(CONNECTION_STR) objConn.Open() objCommand = objConn.CreateCommand() objCommand.CommandText = "SELECT [id],[aname] ,[fname] ,[slink] ,[aimg] From [apps] ORDER BY aname" ' "SELECT * FROM apps ORDER BY aname" objReader = objCommand.ExecuteReader() ComboBox1.Items.Clear() While (objReader.Read()) ComboBox1.Items.Add(objReader("aname")) Dim bytaimg(objReader.GetBytes(1, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte 'returns error "Specified cast is not valid" objReader.GetBytes(1, 0, bytaimg, 0, bytaimg.Length) Dim stmaimg As New MemoryStream(bytaimg) PictureBox1.Image = Image.FromStream(stmaimg) PictureBox2.Image = CType((objReader("aimg")), Image) Dim aid = ("steam://rungameid/" & (objReader("slink"))) ', String) aidlink = aid Dim tid = (objReader("slink")) Me.Text = CType(Application.ProductName & " " & "v" & Application.ProductVersion & " " & "App ID:" & " " & tid, String) End While Catch ex As Exception MessageBox.Show("An error has occurred: " & ex.Message) Finally If Not IsNothing(objConn) Then objConn.Close() End If End Try objConn.Close() End Sub #End Region
Byte
Byte[]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)