]> fbox.kageds.com Git - NEATEST.git/blob - NEA/Store.xaml.vb
754a0aff709af297e5b2c75aec5d4a589f13d91d
[NEATEST.git] / NEA / Store.xaml.vb
1 Imports System.IO
2 Imports System.Drawing
3 Public Class Store
4 Dim id As String
5 Private Sub BtnSearch_Click(sender As Object, e As RoutedEventArgs) Handles btnsearch.Click
6
7 Dim ds As New NEADataSet
8 Dim dr As System.Data.DataRow
9 Dim da As New NEADataSetTableAdapters.GamesTableAdapter
10 Dim dt As System.Data.DataTable
11 dt = ds.Tables("Games")
12 da.Fill(dt)
13 For Each dr In dt.Rows
14 If String.Compare(dr("Name"), txtSearch.Text) = 0 Then
15
16
17 Dim Q As String = "[Name] = '" & txtSearch.Text & "'"
18 Dim result() As NEADataSet.GamesRow = dt.Select(Q)
19
20 id = result(0).GameID
21
22
23 GoTo LineBreak
24 End If
25 Next
26 MsgBox("The game you entered is not in the database", vbExclamation)
27 LineBreak:
28 ds.Dispose()
29
30 For Each dr In dt.Rows
31 If String.Compare(dr("GameID"), id) = 0 Then
32 txtname.AppendText(dr.Item("Name"))
33
34
35
36
37 Dim bytes As [Byte]() = dr.Item("Icon")
38 Dim ms As New MemoryStream(bytes)
39
40 Dim bi As New BitmapImage()
41 bi.BeginInit()
42 bi.StreamSource = ms
43 bi.EndInit()
44
45 imglogo.Source = bi
46 End If
47
48 Next
49 End Sub
50
51 Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
52 Dim a As New AddGame()
53 a.Show()
54
55 End Sub
56 End Class