Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataView vs .Select vs. iterating thru Rows
Message
De
09/01/2004 11:10:14
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
DataView vs .Select vs. iterating thru Rows
Divers
Thread ID:
00865460
Message ID:
00865460
Vues:
115
Hey gang,

I haven't done any kind of benchmark testing, but I will if nobody has a definitive answer to this. I have a DataTable that could have a lot of Rows in it (ok, maybe not thousands, but at least it's possible to have a couple hundred). Anyway, I have a particular row that I'm searching for, based on a key column. I'm trying to determine the fastest, most efficient way to find that row.

The three methods of doing that would be:

1) create a DataView, set the RowFilter
2) use the DataTable.Select() method
3) iterate through every DataRow in the DataTable

I think #3 is probably pretty slow. I'm more familiar with #1, using DataViews, and thought that might be faster, but I don't know how much "overhead" there is in defining the View to begin with. I've not used #2 at all yet, but it seems fairly straightforward. Again, I don't know what to expect in terms of overhead.

Anyone compared these different methodologies?

TIA,
~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform