Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum size of a DataTable I can load into memory in .Net?

What is the maximum size of a DataTable I can load into memory in .Net?

Is there an artificial limitation, or it is only limited by the box I am running the code on?

like image 247
pencilCake Avatar asked Jun 20 '12 15:06

pencilCake


4 Answers

While I'm not sure of the memory footprint, there is a maximum number of rows. From MSDN:

The maximum number of rows that a DataTable can store is 16,777,216.

like image 151
jamesmillerio Avatar answered Oct 15 '22 01:10

jamesmillerio


According to this link, it is based on your machine...but I like the link because if you are wondering about the limits, you might be doing something wrong.

like image 30
Josh Avatar answered Oct 15 '22 01:10

Josh


The maximum size is limited by Int32. So 2^32 is the maximum number of DataTables you can hold inside a DataSet. So the max size is 2 billion. that is approximately 4GB

like image 2
Aket Gupta Avatar answered Oct 15 '22 02:10

Aket Gupta


The maximum number of rows that a DataTable can store is 25,558,144 (visual Studio 2016)

like image 1
Vivian Dsouza Avatar answered Oct 15 '22 01:10

Vivian Dsouza