Excel Automation 3

hi . how can i copy data from row using linq.
i’m comparing 2 id in two different excel . and if the the id in excel 1 find the id in excel 2 it will copy the value of specific column

i used this code to compare two id and write default value in specific column

If(IsNothing (MSMEDT.AsEnumerable.Where(Function (x) x(3).ToString.Equals(currentrow(7).ToString)).FirstOrDefault()),“”,“MSME”)

my goal now is to get the value of specific column with the same condition.

Hi :wave:
Can you give an example on the result you want to achieve?

1 Like


like this

1 Like

hello . how can copy the value from database MSMEDT if not meet the condition. i dont know what syntax im gonna use.
the condition of this syntax here is to locate the same id from dt1 to MSMEDT

If(IsNothing (MSMEDT.AsEnumerable.Where(Function (x) x(3).ToString.Equals(currentrow(7).ToString)).FirstOrDefault()),“”,Nothing)

if the both id is match from both dt . it will check “column sample” from dt1 if it have the same value in the “column sample” from MSMEDT
i want to get the value of “column sample” from MSMEDT and paste it to “sample column” of dt1 if the condition is not meet.

If(IsNothing (MSMEDT.AsEnumerable.Where(Function (x) x(3).ToString.Equals(currentrow(7).ToString)).FirstOrDefault()),
MSMEDT.AsEnumerable.Where(Function(d) d(28).ToString.Equals(currentrow(13).ToString)).FirstOrDefault(),i want to copy the MSMEDT d28,Nothing)

@ldiaz

Share the sample input and output.

Duplicate Topic : Excel Automation 3

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.