1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Dim cnx As New OleDbConnection
Dim cmd = New OleDbCommand("Delete * from Fournisseur where Nom_frs='" & Cbxnomfrs.Text & "'", cnx)
Try
cnx.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Administrateur.STANDARD\Mes documents\Projet Budget\Budget\Budget\Marches.mdb"
cnx.Open()
cmd.connection = cnx
cmd.executenonquery()
MsgBox("Le fournisseur a été supprimé avec succès", MsgBoxStyle.Information + MsgBoxStyle.OkOnly)
Catch ex As Exception
MsgBox(ex.Message)
Finally
If Not (cnx Is Nothing) Then
cnx.Close()
End If
End Try
Me.Validate()
Me.FournisseurBindingSource.RemoveCurrent()
Me.FournisseurTableAdapter.Update(MarchesDataSet)
Frmprincipale.Show()
Me.Close()
End Sub |
Partager