Public Class Store Private Sub BtnSearch_Click(sender As Object, e As RoutedEventArgs) Handles btnSearch.Click Dim id As String 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 MsgBox(txtSearch.Text & " was found in the database") Dim Q As String = "[Name] = '" & txtSearch.Text & "'" Dim result() As NEADataSet.GamesRow = dt.Select(Q) id = result(0).GameID MsgBox(ID) GoTo LineBreak End If Next MsgBox("The game you entered is not in the database", vbExclamation) LineBreak: ds.Dispose() Dim ds2 As New NEADataSet Dim dr2 As System.Data.DataRow Dim da2 As New NEADataSetTableAdapters.GamesTableAdapter Dim dt2 As System.Data.DataTable dt2 = ds2.Tables("Games") da2.Fill(dt2) For Each dr2 In dt2.Rows String.Compare(dr2("GameID"), id) MsgBox(txtSearch.Text & " was found in the database") GoTo LineBreak2 Next MsgBox("The game you entered is not in the database", vbExclamation) LineBreak2: ds2.Dispose() End Sub End Class