-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwraps.vb
More file actions
117 lines (108 loc) · 5.14 KB
/
wraps.vb
File metadata and controls
117 lines (108 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Imports MySql.Data.MySqlClient
Public Class wraps
Dim sqlconn As New MySqlConnection
Dim sqlcmd As New MySqlCommand
Dim sqlrd As MySqlDataReader
Dim sqldt As New DataTable
Dim dataadp As New MySqlDataAdapter
Dim sqlquery As String
Dim server As String = "localhost"
Dim uname As String = "root"
Dim pass As String = "syco2@9"
Dim dbname As String = "myconnector1"
Private Sub wraps_Load(sender As Object, e As EventArgs) Handles MyBase.Load
MaximizeBox = False
MinimizeBox = False
ControlBox = False
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label10.Text & "','" & Integer.Parse(Label5.Text) & "','" & TextBox1.Text & "','" & (Val(Label5.Text * Val(TextBox1.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label6.Text & "','" & Integer.Parse(Label4.Text) & "','" & TextBox2.Text & "','" & (Val(Label4.Text * Val(TextBox2.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label15.Text & "','" & Integer.Parse(Label14.Text) & "','" & TextBox3.Text & "','" & (Val(Label14.Text * Val(TextBox3.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label30.Text & "','" & Integer.Parse(Label29.Text) & "','" & TextBox4.Text & "','" & (Val(Label29.Text * Val(TextBox4.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label25.Text & "','" & Integer.Parse(Label24.Text) & "','" & TextBox5.Text & "','" & (Val(Label24.Text * Val(TextBox5.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label20.Text & "','" & Integer.Parse(Label19.Text) & "','" & TextBox6.Text & "','" & (Val(Label19.Text * Val(TextBox6.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
End Class