大家好,我需要帮助。 我有datagridview我想在我点击更新按钮时更新每行中coloumn 2的单元格..
For i As Integer = 0 To dgvTestsRes.Rows.Count
d.EditData(String.Format("Update sampleResult set samTestResult='{0}' where samResID={1}", dgvTestsRes.Rows(i).Cells(2).Value.ToString(), dgvTestsRes(8, dgvTestsRes.SelectedRows(0).Index).Value.ToString()))
Next
答案 0 :(得分:0)
试试这个:
Try
For Each Line As DataGridViewRow In dgvTestRes.Rows
Line.Cells(1).Value = <YourValue> <- The column starts from 0, so, 1 = column 2
Next
Catch
End Try