Morning,
Regarding the following quote, is this limit independent of how many columns there are? (Im assuming not but its not specifically stated anywhere.) If it is linked to the number of columns, how do you calculate that your not over this limit?
To add rows to a DataTable, you must first use the NewRow method to return a new DataRow object. The NewRow method returns a row with the schema of the DataTable, as it is defined by the table's DataColumnCollection. The maximum number of rows that a DataTable can store is 16,777,216. For more information, see Adding Data to a DataTable.
"Link to where quote was taken from."
Thanks for your help.
I would expect that limit (which is 224) to be independent of the number of columns. I expect that it's just a single 32-bit integer internally is used to represent the row count as 24-bits and 8 bits are used for flags or something similar.
In practice, 16 million rows is going to take a long time to populate and a lot of memory... if you're in danger of hitting that limit, you should probably be rethinking how you're accessing data to start with.