]> fbox.kageds.com Git - NEATEST.git/blob - NEA/Store.xaml.vb
Make DB part of project
[NEATEST.git] / NEA / Store.xaml.vb
1 Public Class Store
2 Private Sub BtnSearch_Click(sender As Object, e As RoutedEventArgs) Handles btnSearch.Click
3 Dim id As String
4 Dim ds As New NEADataSet
5 Dim dr As System.Data.DataRow
6 Dim da As New NEADataSetTableAdapters.GamesTableAdapter
7 Dim dt As System.Data.DataTable
8 dt = ds.Tables("Games")
9 da.Fill(dt)
10 For Each dr In dt.Rows
11 If String.Compare(dr("Name"), txtSearch.Text) = 0 Then
12 MsgBox(txtSearch.Text & " was found in the database")
13
14 Dim Q As String = "[Name] = '" & txtSearch.Text & "'"
15 Dim result() As NEADataSet.GamesRow = dt.Select(Q)
16
17 id = result(0).GameID
18 MsgBox(ID)
19
20 GoTo LineBreak
21 End If
22 Next
23 MsgBox("The game you entered is not in the database", vbExclamation)
24 LineBreak:
25 ds.Dispose()
26
27 Dim ds2 As New NEADataSet
28 Dim dr2 As System.Data.DataRow
29 Dim da2 As New NEADataSetTableAdapters.GamesTableAdapter
30 Dim dt2 As System.Data.DataTable
31 dt2 = ds2.Tables("Games")
32 da2.Fill(dt2)
33 For Each dr2 In dt2.Rows
34 String.Compare(dr2("GameID"), id)
35 MsgBox(txtSearch.Text & " was found in the database")
36
37
38
39 GoTo LineBreak2
40
41 Next
42 MsgBox("The game you entered is not in the database", vbExclamation)
43 LineBreak2:
44 ds2.Dispose()
45 End Sub
46 End Class