kindly let me know is there any way or LINQ code available, i can reconcile the two different table to fine match and unmatched
example table 1
|Name |age|
|kamal|30|
|suresh|20|
|bala|32|
|bala|32|
example table 2
|name|job|
|vimal|developer|
|sutha|BA|
|bala|PM|
after reconcile with both table’s name column expected output of table one matched result
|name|age|
|bala|32|
only one name was matched even that was duplicated. other one was to come in unmatched results like
|name |age|
|kamal|30|
|suresh|20|
|bala|32|
is there any way to make this possible normally i tried with LINQ and join table but its matching both duplicated name so most of the time its really hard to reconcile the duplicated values
LinQ for Matched:
(
From row In dt_MainInput
Join main In dt_InputTable
On row(“Name”).ToString.Trim Equals main(“Name”).ToString.Trim
Select row
).CopyTODataTable().AsEnumerable().DistinctBy(Function(x) x(“Name”).ToString.Trim).CopyToDataTable
LinQ for UnMatched Data:
dt_MainInput.AsEnumerable().Except(dt_OutputMatched.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable
Thank you,
If you have any queries then let me know.
(
From row In dt_MainInput
Join main In dt_InputTable
On row(“Name”).ToString.Trim Equals main(“Name”).ToString.Trim And row(“DOB”).ToString.Trim Equals main(“DOB”).ToString.Trim
Select row
).CopyTODataTable().AsEnumerable().DistinctBy(Function(x) x(“Name”).ToString.Trim).CopyToDataTable
LinQ for UnMatched Data:
dt_MainInput.AsEnumerable().Except(dt_OutputMatched.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable
You just have to add “And” then further condition as mentioned above…!(Matched Output LinQ)