DataTable.Select() vs DataView

  • Thread starter Thread starter Zanna
  • Start date Start date
Z

Zanna

Hi!

Shomeone can tell me if there are some difference using the DataTable.Select
or a DataView to retrieve DataRows?

Wich is faster?

Thanks
 
--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
Zanna said:
Hi!

Shomeone can tell me if there are some difference using the DataTable.Select
or a DataView to retrieve DataRows?

Wich is faster?

As opposed to what? Actually, to be honest, I've found no real difference
between .Select on a datatable and .Find or .FindRows on a dataview.
Setting the rowfilter is also a viable way to filter or restrict data.
Usually the hit is in the binding after calling the methods.
 
Zanna, I've just completed some initial testing using both
data-reduction methods (Dataview.RowFilter and DataTable.Select). I
have an application the retrieves ~100K records for monitoring a
process. Each time the application retrieves the ~100K recordset
(using an IDataReader into a DataView/DataTable) I need to partition
the records into 6 different "views" (not DataViews - just
data-reduced versions of the original recordset) (3 main views and 3
subviews).

What I've noticed...

On the first use of the Dataview.RowFilter vs DataTable.Select the two
methods are virtually the same (timewise - though I think that the
Select method is a bit faster). On every successive interation,
creating a new view of the data, the Select method wins, hands-down
(much faster). Also, for creating the subviews the Select is also much
faster as it only needs to parse the already reduced recordset (where,
it appears that, the DataView.RowFilter needs to refilter against the
entire, original Dataview).

Hope this helps.

Glenn
 
Back
Top