Continuing the discussion from Excel Vlookup Using UiPAth: @MAHESH1
I tried using the LINQ query ,it gives me the below mentioned error
"Range variable name cannot match the name of a member of the ‘object’ class "
Could you please help me out here?
@ppr Main Data Table used for reference Data Table to compare with Main Data table
if AccNo from second dt matches with mainDt we compare the name and Address ,and update the status.
AS of now I am Using Lookup DT(Activity) with For Each Row, I feel LINQ is faster.
Regards.
readSheet2.AsEnumerable.ToList.FindIndex(Function (r) (r(1).ToString+r(2).ToString+r(3).ToString).Equals(row("Name").ToString) And r(0).toString.Equals(row("AccNo").ToString) And r(4).toString.Equals(row("Address").ToString))
@iVishalNayak
Kindly note the referenced case is less complex as it checks only for one Value without any concatenations (Name Cols) and multiple Cols (Name, Adress). Also it has the potential to reduce it with an Any Statement. Also it is not updating any columns in a table
In real scenario we also have the risk that the Name split will increase the complexity on additional.
However task can be solved on:
Join Approach
Filter Approach
For the Join Approach the Join Data Table is a good start
left join dtData TO dtMain
Selecting the result can be done with a LINQ, Also resorting the cols on AccNo INTs in the same statement
For fast Prototyping both will work fine. For Production use it is more recommended to find some balanced approache by combining different buuilding blocks (For Each, Join, Filter…) to enforce the possibilty to maintain and to track.