LINQ query! There two file one master Excel where all data is present and another Excel where customer name is blank now Vlookup with master Excel Account Number match fetch Customer Name and If account no not matched update Customer name update blank in another Excel
Instead of lookup and linq…you can directly use join datatable activity with left type and then filter datatable with the required columns you need
This will match all matched ones and remaining will be blank
If you need a linq only
Then use below in invoke code and pass the first and second dt as in/out arguments dt1 and dt2
Dt1.AsEnumerable.ToList.ForEach(sub(r) r("Name") = If(Dt2.AsEnumerable.Where(function(x) x("Number").ToString.Equals(r("Number").ToString)).Count>0, Dt2.AsEnumerable.Where(function(x) x("Number").ToString.Equals(r("Number").ToString))(0)("Name").ToString,""))
Cheers
Hi @Rohan_Dhole
Use the below linq expression
=> Assign - dtBlankCustomerNames = (From rowBlank In dtBlankCustomerNames.AsEnumerable()
Join rowMaster In dtMaster.AsEnumerable() On rowBlank("Account Number") Equals rowMaster("Account Number")
Select rowBlank.ItemArray(0) = rowMaster("Customer Name") AndAlso rowBlank.ItemArray).CopyToDataTable()
Hope it helps!!