Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
There is a slight memory penalty for using a DataTable with one record, but nothing like using a DataSet. This is the main reason we used a DataTable rather than a DataSet. If you use a DataSet with only one record, you're looking at about 8x the memory usage as a DataTable with only one record.
Realistically, the memory usage penalty is negligable for storing only one record in a DataTable and it's worth it to incur that penalty to be able to store multiple records in the same class that is used to store a single record.
With an O/R mapper, you'd have a slightly smaller memory footprint for each "entity" object, but the entity collections are not as efficient at storing multiple records as a DataTable. The performance and functionality penalties of using the custom collection are far worse than the memory penalty of the DataTable.
Note: This is especially true for .NET 2.0 as the ADO.NET team really improved the indexing performance of a DataTable making it much faster than a custom collection for sorting, filtering, and navigating the records.
|