Private Sub btnfind_Click(sender As Object, e As EventArgs) Handles btnfind.Click
Dim s As String
Dim y0, y1, y2, y3, y4, y5, y6, y7 As String
Dim sp() As String
s = txtProrate.Text 'this text box contains value
sp = s.Split(",")
text1.Text = sp(0)
y0 = sp(0)
y1 = sp(1)
y2 = sp(2)
y3 = sp(3)
y4 = sp(4)
y5 = sp(5)
y6 = sp(6)
y7 = sp(7)
open_database()
sql = "select product_id from reservation where product_id='" & text1.Text & "'"
ds = New DataSet
da = New SqlDataAdapter(sql, cn)
da.Fill(ds)
If (ds.Tables(0).Rows.Count > 0) Then
sql = "delete from reservation where product_id='" & y0 & "'"
Else
MessageBox.Show("Error! ไม่พบข้อมูลในระบบ", "ผลการตรวจสอบ", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
End If
ไม่ทราบว่าผมทำผิดตรงไหนครับ
Tag : .NET, Win (Windows App), VB.NET, VS 2012 (.NET 4.x)