-
Notifications
You must be signed in to change notification settings - Fork 1
/
frmSalarySlip.vb
executable file
·27 lines (25 loc) · 1.61 KB
/
frmSalarySlip.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Imports System.Data.oledb
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class frmSalarySlip
Private Sub SalarySlip_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim rpt As New rptSalarySlip() 'The report you created.
Dim myConnection As oledbConnection
Dim MyCommand As New oledbCommand()
Dim myDA As New oledbDataAdapter()
Dim myDS As New PayrollManagerDBDataSet 'The DataSet you created.
myConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\PayrollManagerDB.accdb;Persist Security Info=False;")
MyCommand.Connection = myConnection
MyCommand.CommandText = "select PaymentID,Datefrom,dateTo,EmployeeRegistration.employeeid,employeename,designation,department,EmployeePayment.salary,presentdays,advance,deduction,overtime,overtimeamount,paymentdate,modeofpayment,netpay from EmployeePayment,EmployeeRegistration where EmployeeRegistration.EmployeeID=EmployeePayment.EmployeeID and PaymentID='" & frmEmployeePayment.PaymentID.Text & "'"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "EmployeePayment")
myDA.Fill(myDS, "EmployeeRegistration")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
End Class