Imports System.IO Imports System.Drawing Public Class Store Dim id As String Private Sub BtnSearch_Click(sender As Object, e As RoutedEventArgs) Handles btnsearch.Click Dim ds As New NEADataSet Dim dr As System.Data.DataRow Dim da As New NEADataSetTableAdapters.GamesTableAdapter Dim dt As System.Data.DataTable dt = ds.Tables("Games") da.Fill(dt) For Each dr In dt.Rows If String.Compare(dr("Name"), txtSearch.Text) = 0 Then Dim Q As String = "[Name] = '" & txtSearch.Text & "'" Dim result() As NEADataSet.GamesRow = dt.Select(Q) id = result(0).GameID GoTo LineBreak End If Next MsgBox("The game you entered is not in the database", vbExclamation) LineBreak: ds.Dispose() For Each dr In dt.Rows If String.Compare(dr("GameID"), id) = 0 Then txtname.AppendText(dr.Item("Name")) Dim bytes As [Byte]() = dr.Item("Icon") Dim ms As New MemoryStream(bytes) Dim bi As New BitmapImage() bi.BeginInit() bi.StreamSource = ms bi.EndInit() imglogo.Source = bi End If Next End Sub Private Sub Button_Click(sender As Object, e As RoutedEventArgs) Dim a As New AddGame() a.Show() End Sub End Class