Chris Falter

.NET Design and Best Practices
posts - 38, comments - 56, trackbacks - 24

My Links

News

All source code published on this blog is placed in the public domain.

Archives

Post Categories

Image Galleries

About Me

Why You Might Prefer a DataView to an Array of DataRecord

Before we get too obsessed about the performance advantages of an array of DataRecord over a DataView, let's remember that a DataView behaves differently than an array of DataRecord.  No matter how you modify the data in an array of DataRecord, the array bounds will always be the same.  However, modifying a field in a DataRecord may cause it to disappear from a DataView, if the modification causes the record to be filtered by the DataView.Filter property.  Or if you modify a DataRecord in a DataTable, you might cause it to suddenly appear in a related DataView. 

If you need this kind of dynamic, event-driven update of set membership, you are going to have to use a DataView, regardless of the performance considerations.  If you don't need the dynamic set membership update, then performance considerations would suggest you use an array of DataRecord.

Print | posted on Monday, August 07, 2006 7:47 PM | Filed Under [ Coding Practices and Design Patterns Performance & Tuning ]


Feedback

No comments posted yet.


Post Comment

Title  
Name  
Email
Url
Comment   
Please add 1 and 2 and type the answer here:

Powered by: