Essaye en faisant ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 Private Sub BindingNavigatorAddNewPays_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewPays.Click If Txt_sigle.Text = "" And Txt_Pays.Text = "" Then MsgBox("Une pays doit avoir un sigle") Else Try dtreader = commande.requete("INSERT Into tblPays(idpays, sigle, pays) VALUES ('" + Txt_idpays.text + "', '" + Txt_sigle.Text + "','" + Txt_Pays.Text + "')", connec) dtreader.Close() MsgBox("Un pays a été ajouté à votre liste") Txt_sigle.Text = "" Txt_Pays.Text = "" afficher() Catch ex As Exception MsgBox("Veuillez insérer un pays ") End Try 'afficher() End If End Sub




Répondre avec citation




Partager