DataGridView1
1. fromDate = Date/Time 2. ToDate = Date/Time 3. EmpID = Text 4. WorkDays = Number 5. DialyRate = Currency 6. Total = Currency 7. RegOT = Currency 8. RegOTTotal = Currency 9. SunOT = Currency 10. SunOTTotal = Currency 11. HolPay = Currency 12. HolPayTotal = Currency 13. Allowances = Currency 14. Incentives = Currency 15. EmployerContributions = Currency 16. Others = Currency 17. GROSS = Currency 18. EmployeeContribution = Currency 19. Loans = Currency 20. GovTax = Currency 21. Late = Currency 22. OtherDeduction = Currency 23. TotalDeductions = Currency 24. NetPayment = Currency
Imports System.Data.OleDb Public Class DeletePayroll Dim CnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "\EmployeesInfo.mdb;Jet OLEDB:Database Password=employees" Dim Con As New OleDbConnection(CnString) Dim CMD As New OleDbCommand Dim strselectedEmpID As String Private Sub DeletePayroll_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Con.Open() filldata() Con.Close() End Sub Private Sub filldata() Dim da As New OleDbDataAdapter("select * from Payroll Order by EmpID", Con) Dim ds As New DataSet da.Fill(ds, "Payroll") DataGridView1.DataSource = ds.Tables("Payroll") End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Con.Open() Dim cmd As New OleDbCommand("delete * from Payroll where EmpID='" & strselectedEmpID & "'", Con) cmd.ExecuteNonQuery() MsgBox("Data Deleted Successfully", MsgBoxStyle.Exclamation, "Delete Record") filldata() Con.Close() End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)