Programming for Everybody: Delete button database access vb.net

Delete button database access vb.net

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\gamal\Pictures\aa.mdb")
        Dim cmd As New OleDbCommand("", conn)
        cmd.CommandText = "delete from table1 where tel='" + TextBox4.Text + "' "
        conn.Open()
        cmd.ExecuteNonQuery()
        conn.Close()
        ' Refresh Datagridview
        Me.Table1TableAdapter.Fill(Me.AaDataSet1.Table1)
    End Sub

No comments:

Post a Comment