CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Raymond Lewallen

Professional Learner

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.


Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Raymond Lewallen

Working primarily in the public sector during his career, Raymond has designed and built several high profile enterprise level applications for all levels of the government. Raymond now works as a solutions architect for EMC. Raymond is an agile coach, Microsoft MVP C# and also president of the Oklahoma City Developers Group and Oklahoma Agile Developers Group. Raymond spends a lot of his time learning and teaching such things as Test Driven Development, Domain Driven Design, Design Patterns and Extreme Programming practices and principles, to name a few. Raymond is also an advocate of Alt.Net. Raymond is primarily a framework guy, so don't ask him anything about UI :) Check out Devlicio.us!

Our Sponsors

Free Tech Publications