error ว่า >>>>>ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.
sqlProducts = "SELECT ID_P,Remain_P FROM t_Products"
sqlProducts &= " WHERE (ID_P='" & tmpID_P & "')"
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
If txtID_E.Text.Trim() = "" Then
MessageBox.Show("กรุณาป้อนรหัสผู้ยืมก่อน !!!", "ข้อผิดพลาด", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtID_E.Focus()
Exit Sub
End If
If lsvProductsList.Items.Count > 0 Then
If MessageBox.Show("คุณต้องการบันทึกรายการยืมอุปกรณ์ ใช่หรือไม่ ?", "คำยืนยัน", MessageBoxButtons.YesNo, MessageBoxIcon.Information) = DialogResult.Yes Then
tr = Conn.BeginTransaction()
sb.Remove(0, sb.Length)
sb.Append("INSERT INTO I_Customer (ID_M,Name_M,Data_W,DataCheck_W,Tel_M,Address_M)")
sb.Append(" VALUES (@ID_M,@Name_M,@Data_W,@DataCheck_W,@Tel_M,@Address_M)")
Dim sqlSave As String = sb.ToString()