For i = 0 To ListView1.Items.Count - 1
id = ListView1.Items(i).Text
MsgBox(id + "jcompile")
name = ListView1.Items(i).SubItems(1).Text
Con = New OleDb.OleDbConnection("Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=rut;Data Source=192.168.1.112")
Sql = "select productid,productname from product"
Cmd = New OleDb.OleDbCommand(Sql, Con)
Con.Open()
Reader = Cmd.ExecuteReader()
While Reader.Read()
For Columns = 0 To Reader.FieldCount - 1
proid = Reader.Item(Columns).ToString
If proid = id Then
MsgBox(proid + "rut update") 'ตรงนี้เช็คได้ค่ะแต่ไม่รู้ว่าต้องเขียน sql อย่างไร
End If
Next
ComboRow += 1
End While
Con.Close()
Next