Raymond Lewallen

A few things .Net, a few things Sql

<September 2008>
SuMoTuWeThFrSa
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011


Navigation

General

Subscriptions

Post Categories



DataRowCollection no longer uses arraylist

I'm sure if you have ever dealt with large datatables and tried to remove rows from them, you have come across the agonizing time it takes to do so. This dicussion recently came up on microsoft.public.dotnet.framework.adonet newsgroup. When you have a large datatable, removing datarow objects from the rows container is extremely slow. The datatable uses an arraylist to store the data. When you try to remove a row, it checks .Contains() to see if it exists first, and then reorders the rows upon removing a row.

Good news is on the way. Straight from the mouth (or keyboard, actually) from a member of the DataWorks team at Microsoft: in Beta2, the arraylist is no longer used as backing support for the datatable. I was not told, however, if they switched to use a hashtable, which seems to be the logical choice to me. So as far as I know, its still speculation as to what will be used, but thankfully, whatever it will be, its not the arraylist anymore and should speed up the removal of row objects from the rows collection much faster.

If anyone has any further information on this, I would love to know.

posted on Friday, December 03, 2004 5:09 AM by rlewallen





Powered by Dot Net Junkies, by Telligent Systems