Sometimes we need to easily make a select on a table, and usually most of developers will use loop through the rows of the DataTable and find the row that developer is searching for or the collection of rows.
I came across this problem too, and I was thinking why it isn't possible to use Linq to select those rows?
To solve this we need to make from the DataTable an Enumerable. Below I have provided two examples in linq - sql style and in linq using expressions.
Code:
Code:
Which one to use is already your choice.
Thanks for attention.
No comments:
Post a Comment
your thoughts are welcome: