Here's my code:
Please note that I use 'AC' column as a comparison factor because if it is different then all other columns are different as this column represents the total of all other columns' calculations. Also, please note that I need to print all the columns in the report and that's why I load them all with the TableAdapter.FillCode:Dim myCON As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myDB.mdb;Jet OLEDB:Database Password=xxxxxxxxxx" DT1TableAdapter.Connection.ConnectionString = myCON DT1TableAdapter.Connection.Open() DT2TableAdapter.Connection.ConnectionString = myCON DT2TableAdapter.Connection.Open() DT1TableAdapter.Fill(DataSet1.DT1) DT2TableAdapter.Fill(DataSet1.DT2) DT1BindingSource.MoveFirst() DT2BindingSource.MoveFirst() For i = 0 To DT1BindingSource.Count – 1 C_ID1 = DT1BindingSource.Current("ID") C_AC1 = DT1BindingSource.Current("AC") DT2BindingSource.Filter = "ID=" & "'" & C_ID1 & "'" C_AC2 = DT2BindingSource.Current("AC") If C_AC1 <> C_AC2 Then Dim DRV As DataRow = DirectCast(DT1BindingSource.Item(i), DataRowView).Row DataSet1.TempDT.Rows.Add(DRV.ItemArray) End If DT1BindingSource.MoveNext() Next End If … load the report (TempDT as datasource)
Thanks




Reply With Quote
