Bonjour
Dans ce code,dans une bouton "supprimer",je veux savoir ou mettre un msgbox "etes-vous sure de suuprimer?" avant de confirmer la suppression
Code
-------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim TextCode = DataGridView1.SelectedRows(0).Cells(0).Value.ToString()
MsgBox(TextCode)
Dim cnx As New SqlConnection
cnx.ConnectionString = ("Data Source=PC\SQLEXPRESS;Initial Catalog=bd;Integrated Security=True;" )
Dim cmd As New SqlCommand("DELETE FROM Fournisseur WHERE Code='" & TextCode & "'", cnx)
If DataGridView1.SelectedRows.Count = 1 Then
Dim row As DataGridViewRow
row = DataGridView1.SelectedRows(0)
DataGridView1.Rows.Remove(row)
End If
cnx.Open()
cmd.ExecuteNonQuery()
MsgBox("supprimé" )
cnx.Close()
End Sub
merci d'avance