>Is there any advantage to using Linq to iterate through the rows in a datatable, versus foreach?
I'm guessing that you mean is it better to use Linq to select a subset of Rows from a DataTable rather than iterating and selecting them using 'foreach' code ?
If so the answer might depend on what you are trying to select.
But, IMO. the Linq statement will be quicker and simpler to write - and require a lot less code.
OTOH if the selection criteria is simple then 'foreach' may give better performance.....
Any specific scenario in mind ?
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only