Reputation: 1436
What combination is less memory hungry:
A DatatSet with multiple DataTables or a Dictionary with multiple DataTables?
I only need a Collection of DataTables, the whole functions of a DataSet is not required...
Upvotes: 0
Views: 2169
Reputation: 460228
The difference will be negligible, so i would use a DataSet
since it's the appropriate container for multiple tables. But you could also use a DataTable[]
or List<DataTable>
. It's up to you.
In terms of memory consumption the difference (if any) is irrelevant. Chose the type of collection which is most appropriate for your task. If you need to lookup the table by name use a DataSet
or Dictionary<string, DataTable>
. If you just need a collection for multiple tables chose IList<DataTable>
(array or list). As already stated, i would use a DataSet
because it's the natural collection for DataTables.
Upvotes: 3