1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| '
' Ajoute une nouvelle ligne
'
' @param [Void]
' @return [Boolean] True si l'ajout a été fait, False en cas d'erreur
'
Private Function ajouter() As Boolean
Try
Dim drNouvelleLigne As DataRow = dsTableB.Tables(K_TABLE_B).NewRow()
drNouvelleLigne(K_CHAMP_LIBELLE_A) = txtLibelleA.Text
drNouvelleLigne(K_CHAMP_ID_FK_B) = cbTableA.SelectedValue
dsTableB.Tables(K_TABLE_B).Rows.Add(drNouvelleLigne)
Return True
Catch ex As Exception
MessageBox.Show(ex.Message, "Impossible d'ajouter l'enregistrement!", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return False
End Try
End Function |
Partager