I have a DataGridView
with columns
- Illness
- GrandpaP
- GrandpaM
- Father
- Mother
- Uncle
- Brothers
- Cousins
I add diseases to the first column through:
objeto.Rows.Add("Hipertensión Arterial")
objeto.Rows.Add("Obesidad")
objeto.Rows.Add("Cardiopatía")
objeto.Rows.Add("Epilepsia")
objeto.Rows.Add("Artritis Reumatoide")
objeto.Rows.Add("Cancer")
objeto.Rows.Add("Malformaciones Congénitas")
objeto.Rows.Add("Enfermedades Mentales")
objeto.Rows.Add("Dislipidemia")
objeto.Rows.Add("Diabetes")
objeto.Rows.Add("Drogas/Alcohol")
objeto.Rows.Add("Asma Bronquial")
The problem arises that I want to insert it into the database every time I finish counting the Columns that were selected in that row, but it prints me values that I do not want. That is, when the route ends in the columns do not increase the value of the rows
For Renglones As Integer = 0 To dtg_antecedentesH.RowCount - 1
For Columnas As Integer = 0 To dtg_antecedentesH.ColumnCount - 1
If (Columnas > 0) Then
'MsgBox(Renglones)
If (Convert.ToBoolean(dtg_antecedentesH.Item(Columnas, Renglones).Value)) Then
arregloFamiliarEnf(Columnas) = "si"
MsgBox(arregloFamiliarEnf(Columnas))
arregloEnfermedad = dtg_antecedentesH.Item(0, Renglones).Value
MsgBox(arregloEnfermedad)
Continue For
End If
End If
Next Columnas
Insertar_ExpedienteEnfermedades(arregloFamiliarEnf, arregloEnfermedad)
Next Renglones