I have a datagridview with a checkbox column at the beginning, what i want to happen is that when I press the Ok button it will update the Requested row in my EquipmentDetail table with the corresponding checked chekcboxes.
The problem is that when I check even only one checkbox ... All of the rows are updated into true even if its not checked in the datagridview ...
For Each row As DataGridViewRow In DataGridView1.Rows
req = row.Cells(Column1.Name).Value
If row.Cells("Column1").Value = True Then
Dim sql2 As String = "UPDATE EquipmentDetail SET Requested = '" & req & "'"
cmd2.Connection = connection
cmd2.CommandText = sql2
cmd2.ExecuteNonQuery()
End If
Next
connection.Close()
End Sub
help me please ... thanks ...