Friend Sub keep_log(log_work As String)
Dim i As Integer = DataGridView1.CurrentRow.Index
Dim product_id As String = DataGridView1.Item(0, i).Value
Dim product_amount As Integer
If log_work = "exit" Then
product_amount = numexit.Value
Else
product_amount = numin.Value
End If
open_database()
sql = "INSERT INTO log_product (log_product_id, log_amount, log_work) VALUES (" & "'" & product_id & "'," & product_amount & ",'" & log_work & "')"
cmd = New SqlCommand(sql, cn)
cmd.EndExecuteNonQuery() <----- เออเร่อ ตรงนี้ครับ
End Sub