Miyerkules, Setyembre 6, 2017

Update Button Control Code



------------------------------------------------------------------------------------------------------------
COpy and paste the code below after Public Class Form2
--------------------------------------------------------------------------------------------------------------

 con.Open()
        Dim rs As New OleDb.OleDbCommand("Update table1 set FirstName = '" & txtfirstname.Text & _
                                         "', MiddleName = '" & txtmiddlename.Text & _
                                         "', LastName = '" & txtlastname.Text & _
                                         "', Birthdate = '" & DateTimePicker1.Value.ToShortDateString.ToString & _
                                         "', Age = '" & txtage.Text & _
                                         "', Gender = '" & cmbgender.Text & _
                                         "', Street_Brgy = '" & txtstreetbaranggay.Text & _
                                         "', City = '" & txtcity.Text & _
                                         "', Province = '" & txtprovince.Text & _
                                         "', PostalCode = '" & txtpostalcode.Text & _
                                         "', Job_Position ='" & txtjobposition.Text & _
                                         "', Salary = '" & txtsalary.Text & _
                                         "', Deductions = '" & txtbonus.Text & _
                                         "', Bonus = '" & txtgrosssalary.Text & _
                                         "', GrossSalary = '" & txtgrosssalary.Text & _
                                         "', Netpay= '" & txtnetpay.Text & _
                                         "' where EmpIDno = '" & txtempidno.Text & "'", con)

        rs.ExecuteNonQuery()
        con.Close()
        displaydata()




Walang komento:

Mag-post ng isang Komento