i have created another table in the database, i have an idea on how to compare them, the problem is adding the ones that are not in one table into the other table.pls help. my code looks like this:
Dim dataset1 As System.Data.OleDb.OleDbCommand = New System.Data.OleDb.OleDbCommand(daPayroll.SelectCom mand.CommandText = "SELECT * FROM PayrollTable")
Dim dataset2 As System.Data.OleDb.OleDbCommand = New System.Data.OleDb.OleDbCommand(daPayroll.SelectCom mand.CommandText = "SELECT * FROM Payroll")
If dataset1 Is dataset2 Then
Msgbox("yes", "test",MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MsgBox("no", "test", MessageBoxButtons.OK, MessageBoxIcon.Information)
Try
conPayroll.Open()
OleDbInsertCommand1.CommandText = "INSERT INTO PayrollTable (AccomAssistance, Active, BondPayment, BondSubsidy, Coy, " & _”[Date of Birth], [Employer Code], EngagementDate, [Gang Code], HousingAllowance, IDNo, Initials, JobDescription, [Major Business Unit], MaritalStatus, masPayrollID, [Memo], MineRental, [Old Coy], [Pay Grade], [Pay Point], Payroll, PFNo, pkey, [Process Code], [Responsibility Code], Status, [Sub Type Employment], Surname" & _
", TerminationDate, [Type Employment], UserPayroll, valMineID, valOperationID, valPayrollCategoryID, WLAllowance) VALUES (5550.00, dataset2.Active, dataset2.BondPayment, dataset2.BondSubsidy, dataset2.Coy, dataset2.[Date of Birth], dataset2.[Employer Code], dataset2.EngagementDate, dataset2.[Gang Code], dataset2.HousingAllowance,IDNo, Initials, JobDescription, dataset2.[Major Business Unit], dataset2.MaritalStatus, dataset2.masPayrollID, dataset2.[Memo], dataset2.MineRental, dataset2.[Old Coy], dataset2.[Pay Grade], dataset2.[Pay Point], dataset2.Payroll, dataset2.PFNo, dataset2.pkey, dataset2.[Process Code], dataset2.[Responsibility Code], dataset2.Status, dataset2.[Sub Type Employment], dataset2.Surname, dataset2.TerminationDate, dataset2.[Type Employment], dataset2.UserPayroll, dataset2.valMineID, dataset2.valOperationID,dataset2.valPayrollCategor yID, dataset2.WLAllowance)"
daPayroll.InsertCommand.ExecuteNonQuery()
Msgbox.Show("Query successful", "Informtion", MessageBoxButtons.OK, MessageBoxIcon.Information)
I hope anybody can help me.