hello community
I have a problem with a linq expression, I already use the first expression and everything was going fine, I added another rule and now it’s going wrong, that is, the table returns empty even though there are values corresponding to the rule.
This was the expression I used and it worked:
dtOrdenada.AsEnumerable().Where(Function(row) DateTime.ParseExact(row(3).ToString(), “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture) >= DateTime.Today.AddDays(15 ) AndAlso row(0).ToString().Contains(“CAR_DUPL”) AndAlso row(1).ToString().Contains(“Invoice”) AndAlso Convert.ToDouble(row(5)) > dbl_valorNCMB).CopyToDataTable()
this is what I’m trying to implement and now it’s going wrong: (what’s in bold is what I had to add)
Note: it is the same table, with the same data types
dtOrdenada.AsEnumerable().Where(Function(row) DateTime.ParseExact(row(3).ToString(), “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture) >= DateTime.Today.AddDays(15 )AndAlso
DateTime.ParseExact(row(2).ToString(), “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture) >= DateTime.Today.AddDays(5) AndAlso
row(0).ToString().Contains(“CAR_DUPL”) AndAlso
row(1).ToString().Contains(“Invoice”) AndAlso
Convert.ToDouble(row(5)) > dbl_valorNCMB
).CopyToDataTable()
Could you help me??