Maximum size of DataTable

etl2016

Active member
Joined
Jun 29, 2016
Messages
39
Programming Experience
3-5
hi,

I am referring to DataTable Class (System.Data) (or its .net Framework equivalent)

There is no official confirmation about the maximum size of data that can be held in a DataTable object (sorry, if it is there in the documentation and am missing it)

In general, 1 row can be of any number of columns. And, each of these columns can be of any data type, resulting in varying size of storage. More the columns, higher the MB to hold those many rows in DataTable object. Is the amount of data that can be put in a DataTable object, DotNet version dependent or underlying machine configuration dependent? In either case, what is this limit (rows wise and/or MB wise)?

thank you
 
With current implementations this is dependent on available memory. But also recall, that nothing currently restricts the DataTable implementation to store all its data in memory. Some future implementation may decide to have a file based backing store, or talk to a live database if it was populated using a database adapter.

Also consider the top end for accessible number of rows by index: You can only use a signed integer as index for DataRowCollection:

But you are not forced access a DataTable's rows by index. You could use an enumerator and that will walk the internal red-black tree used to hold the rows by the current implementation.

If you are asking about memory limits of a DataTable, you may have the wrong design or architecture in mind.
 
Back
Top Bottom