Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which Is Better?
Message
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Divers
Thread ID:
01457640
Message ID:
01457653
Vues:
90
>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 ?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform