26-01-22 08:07 PM
27-03-22 05:08 PM
var differences =
(from drPMD in PMD.AsEnumerable()
join drPFS in PFS.AsEnumerable() on drPMD.Field<string>(@"G/L Acct") equals drPFS.Field<string>(@"G/L acct") into match
from drPFS in match.DefaultIfEmpty()
where (drPFS == null) || (drPMD.Field<string>(@"Curr") != drPFS.Field<string>(@"Acct cu")) ||
(drPMD.Field<string>(@"FStGro") != drPFS.Field<string>(@"Fld stat")) ||
(drPMD.Field<string>(@"Sort") != drPFS.Field<string>(@"Sort"))
select drPMD).ToList();
Differences = differences.CopyToDataTable();
27-01-22 12:12 PM
27-01-22 03:28 PM
27-01-22 05:50 PM
var differences = excel2.AsEnumerable().Except(excel1.AsEnumerable(), DataRowComparer.Default);
Differences = differences.Any() ? differences.CopyToDataTable() : new DataTable();
FYI - Your username on the Community probably shouldn't contain an "@" sign as it screws up the mention feature a bit.
31-01-22 12:21 PM
A B C D E A B C D E
11 22 33 AB 55 11 22 33 XY 56
11 23 33 44 SS 11 23 33 GG JJ Till here it's fine and result are ok
11 24 33 44 55 11 26 33 44 55 BUT from here onwards results are showing wrong
11 25 33 44 55 11 27 33 44 55
11 26 33 44 55 11 24 33 44 55
11 27 33 44 55 11 25 33 44 55
I have created 2 collections for these 2 excel files and then merged these 2 collections into 1 collection.
And then compare row by row for each column, till first 2 rows the result is fine but afterward it's giving the wrong result.
Is there any way out to compare these files like..... eg. the value (24 )in the 3rd row of the 2nd column (B) in the first file, if it won't find the value (24) in the 3rd row of the 2nd column in 2nd file then it should move directly to 4th row of 2nd file until it gets the same value till the end? AND if it won't find the value in the 2ns file till the end then it should come back to the 4th row of the first file and start the comparison again in the same way and if it found any difference then catch it and save?
I hope some code stage will work BUT honestly, I don't have any idea as of now.
If you supporter/helper need any other information then please feel free to ask me.
Will be highly grateful for any reply !!!
Thank you
31-01-22 06:03 PM
var differences =
(from drColl2 in Collection2.AsEnumerable()
join drColl1 in Collection1.AsEnumerable() on drColl2.Field<string>(@"G/L Acct") equals drColl1.Field<string>(@"G/L Acct") into match
from drColl1 in match.DefaultIfEmpty()
where drColl1 == null || !DataRowComparer.Default.Equals(drColl2, drColl1)
select drColl2).ToList();
Differences = differences.CopyToDataTable();
var differences =
(from drColl2 in Collection2.AsEnumerable()
join drColl1 in Collection1.AsEnumerable() on drColl2.Field<string>(@"G/L Acct") equals drColl1.Field<string>(@"G/L Acct") into match
from drColl1 in match.DefaultIfEmpty()
where drColl1 == null || drColl2.Field<string>(@"Acct Curr") != drColl1.Field<string>(@"Acct Curr")
select drColl2).ToList();
Differences = differences.CopyToDataTable();
01-02-22 12:03 PM
var differences = (from drColl2 in Collection2.AsEnumerable() join drColl1 in Collection1.AsEnumerable() on drColl2.Field<string>(@"G/L Acct") equals drColl1.Field<string>(@"G/L Acct") into match from drColl1 in match.DefaultIfEmpty() where drColl1 == null || !DataRowComparer.Default.Equals(drColl2, drColl1) select drColl2).ToList();Differences = differences.CopyToDataTable();
var differences = (from drColl2 in Collection2.AsEnumerable() join drColl1 in Collection1.AsEnumerable() on drColl2.Field<string>(@"G/L Acct") equals drColl1.Field<string>(@"G/L Acct") into match from drColl1 in match.DefaultIfEmpty() where drColl1 == null || drColl2.Field<string>(@"Acct Curr") != drColl1.Field<string>(@"Acct Curr") select drColl2).ToList();Differences = differences.CopyToDataTable();
01-02-22 12:13 PM
03-03-22 05:15 PM
03-03-22 11:29 PM