Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which Is Better?
Message
General information
Forum:
ASP.NET
Category:
LINQ
Miscellaneous
Thread ID:
01457640
Message ID:
01457653
Views:
89
>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
Map
View

Click here to load this message in the networking platform