It works Perfectly! Thank you very much!
I am trying to understand AsEnumerable - Search a bit: it said it’s LINQ to Object and it’s on the client side.
I tried to remove AsEumerable in the code that you provided and it said ‘Where is not a member of System.Data.DataTable’.
So… I assume .AsEnumerable change the type of dt into object. And based on this dt object, it processes the conditions. Is this a correct understanding? If not, could you kindly give a brief explanation why we need to use Enumerable or IEnumerable? Thanks!
The way I understand it is that LINQ methods can only work on “countable” objects such as Arrays, Lists, and Enumerables (which is a synonym for countable). So, that’s why Data Tables need to be converted to a countable format first, and when you do it understands the countable objects as the Data Rows within the table.