If I have a DataTable with a small or large amount of data, to select data from the datatable I can use the Datatable.Select() method or go for LINQ. Which one is faster and efficient?
If I have a DataTable with a small or large amount of data, to
Share
Which one is best for your circumstance? Or, more importantly, does the speed difference for the amount of data you’re querying make it worthwhile to choose one over the other?
LINQ is generally easier to read, on my opinion, than pretty much any other form of data filtering and has the advantage over using
DataTable.Selectof being, at least partially, strongly-typed making it harder to make mistakes.The LINQ query is bigger, but personally I think it’s more readable