Programming for Everybody: update button database access vb.net

update button database access vb.net

 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 = "update table1 set firstname='" & TextBox1.Text & "', lastname='" & TextBox2.Text & "',country='" & TextBox3.Text & "'where tel='" + TextBox4.Text + "' "
        conn.Open()
        cmd.ExecuteNonQuery()
        conn.Close()
        ' Refresh Datagridview
        Me.Table1TableAdapter.Fill(Me.AaDataSet1.Table1)

No comments:

Post a Comment