Geeks With Blogs
Chris Falter .NET Design and Best Practices

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.

Posted on Monday, August 7, 2006 7:47 PM Coding Practices and Design Patterns , Performance & Tuning | Back to top


Comments on this post: Why You Might Prefer a DataView to an Array of DataRecord

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Chris Falter | Powered by: GeeksWithBlogs.net