Dim sqldel As String = ""
Dim cmdremove As SqlCommand = New SqlCommand
Dim qclick As String = ""
Dim nameclick As String = ""
Dim dateclick As Date
sqldel = "DELETE FROM tb_datasurveyor "
sqldel &= "WHERE ds_queue ='" & qclick & "' AND ds_date = '" & dateclick & "'"
With cmdremove
.CommandType = CommandType.Text
.CommandText = sqldel
.Connection = con
.ExecuteNonQuery()
End With
MessageBox.Show("ลบข้อมูลเรียบร้อย", "ข้อความจากระบบ", MessageBoxButtons.OK, MessageBoxIcon.Information)
Private Sub dgvshow_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvshow.CellClick
qclick = dgvshow.CurrentRow.Cells(1).Value.ToString
nameclick = dgvshow.CurrentRow.Cells(2).Value.ToString
dateclick = CDate(dgvshow.CurrentRow.Cells(0).Value)
End Sub