Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox3.Text = "" Or TextBox4.Text = "" Or ComboBox1.Text = "กรุณาเลือก" Then
MsgBox("กรุณากรอกให้ครบด้วย", MsgBoxStyle.Critical, "เกิดข้อผิดพลาด")
Else
If ComboBox1.Text = "Other" Then
'TextBox2.ReadOnly = False
Dim d As String
d = DateTimePicker1.Value.ToString("d")
Dim skinae As String = "insert into skinpricktestAE values('" & hn1.Text & "','" & d & "','" & TextBox2.Text & "'," & TextBox3.Text & " "
skinae &= "," & TextBox4.Text & ")"
If clsdb.queryexecute(skinae) = True Then
MsgBox("บันทึกเรียบร้อย", MsgBoxStyle.Information, "เรียบร้อย")
skin1()
cls()
End If
Else
Dim d As String
d = DateTimePicker1.Value.ToString("d")
Dim skinae As String = "insert into skinpricktestAE values('" & hn1.Text & "','" & d & "','" & ComboBox1.Text & "'," & TextBox3.Text & " "
skinae &= "," & TextBox4.Text & ")"
If clsdb.queryexecute(skinae) = True Then
MsgBox("บันทึกเรียบร้อย", MsgBoxStyle.Information, "เรียบร้อย")
skin1()
cls()
End If
End If
End If
End Sub
Insert ตัวที่สอง(VB.NET)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox6.Text = "" Or TextBox7.Text = "" Or ComboBox2.Text = "กรุณาเลือก" Then
MsgBox("กรุณากรอกให้ครบด้วย", MsgBoxStyle.Critical, "เกิดข้อผิดพลาด")
Else
If ComboBox2.Text = "Other" Then
Dim d As String = DateTimePicker2.Value.ToString("d")
Dim skinfd As String = "insert into skinpricktestFood values('" & hn2.Text & "','" & d & "','" & TextBox5.Text & "'," & TextBox6.Text & " "
skinfd &= "," & TextBox7.Text & ")"
If clsdb.queryexecute(skinfd) Then
MsgBox("บันทึกเรียบร้อย", MsgBoxStyle.Information, "เรียบร้อย")
skin2()
cls()
End If
Else
Dim d As String = DateTimePicker2.Value.ToString("d")
Dim skinfd As String = "insert into skinpricktestFood values('" & hn2.Text & "','" & d & "','" & ComboBox2.Text & "'," & TextBox6.Text & " "
skinfd &= "," & TextBox7.Text & ")"
If clsdb.queryexecute(skinfd) Then
MsgBox("บันทึกเรียบร้อย", MsgBoxStyle.Information, "เรียบร้อย")
skin2()
cls()
End If
End If
End If
End Sub