Question I will ask is easy to understand; I have 2 datatables, lets call them “mainDT” and “otherDT”, SO I compare these 2 datatables row counts if they are same I move forwards, If they are not I stop the execution and log the message saying rows counts are not same.
It seems like in either case you want OtherDT to match MainDT. You could do an inner join on both DTs (ijDT).
If rows.count match for all 3 DTs, the OtherDT = MainDT. If they do not match, you would need two similar logic blocks using “For Each Row” on both MainDT and OtherDT.
If a row is in MainDT, but not ijDT, the row is missing from OtherDT.
If a row is in OtherDT, but not ijDT, the row is extra in OtherDT.
There are probably slightly faster ways to do the above, but you need to be careful overusing things like “Count” since presumably OtherDT could have both a missing row, and an extra row, so count would match the MainDT.