Private Sub Updatebtn_Click(sender As System.Object, e As System.EventArgs) Handles Updatebtn.Click If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or ComboBox1.Text = "" Then MsgBox("Please Fill All Details") Exit Sub End If Try con.Close() con.Open() str = "UPDATE Customers set CustomerName=@name,Address=@Address,Phone=@Phone,EyePower=@EP,ConsutantDoctor=@CD where CustomerID=@CID" cmd = New OleDbCommand(str, con) cmd.Parameters.AddWithValue("@name", TextBox1.Text) cmd.Parameters.AddWithValue("@Address", TextBox2.Text) cmd.Parameters.AddWithValue("@Phone", TextBox3.Text) cmd.Parameters.AddWithValue("@EP", TextBox4.Text) cmd.Parameters.AddWithValue("@CD", TextBox5.Text) cmd.Parameters.AddWithValue("@CID", ComboBox1.Text) cmd.ExecuteNonQuery() MsgBox("Record Updated Successfully", MsgBoxStyle.Information, MsgBoxStyle.OkOnly) Catch ex As Exception MsgBox("Error", ex.Message) Finally con.Close() End Try End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)