Comapre Two datables and check if all the Rows matches To another datatable Then write Y in sheet else N.
I am try to use For each in For each to compare Rows from the First data table to second datatable so i a can check the First table rows is present in another Table
For example :-
table1row1(“Brand Id”).ToString = table2(“Column-1”).ToString
But my problem is that if the first row is not found and second row is found then i have Write status Incorrect as one of the row is Incorect and if both the rows are found the write correct
i think the logic is correct but i cannot understand the build table and Conditions properly, can you provide me Workflow??
Here is the Project which contains the built workflow. You will refer the below attachement
DataTable Task.zip (287.0 KB)
Regards, I hope it will help!!
You can know if two datatables are matchign or not directly using this in if condition
Dt1.AsEnumerable.Except(Dt2.AsEnumerable,DataRowComparer.Default).Count>0
On then side the rows are not matched and on else side rows are matched
Hope this helps
Cheers
i want to say that if the Status column contain all “Value matched” then i have to say data is Correct i.e"yes" else “No”
For checking the status column, do iteration with for each row in datatable activity.
Use if condition inside the loop. If Currentrow(“Status”).contains(“Value Matched”) then take a count “ValueMatchCount” variable and increment it, In else take a “NoValueMatchCount” and increment it.
Then Take the another if condition that “No Match Count”=0, then say “Yes” else say “No”.
I hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.