tags:

views:

60

answers:

3

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

Datatable max rows - 16,777,216,

Datatable max columns - ????

Can't seem to find the max columns.

+1  A: 

I think it's just over 1,000 though if you are seriously asking this question then maybe you need to look at your data structure rather than datatable limitations.

It might help to explain why you need so many columns.

griegs
Thanks for the suggestion but in my learning i think it should be same but i don't know exactly and this question was just to grow theoretical knowledge.
Wazzy
+1  A: 

int.MaxValue but you are likely to get an OutOfMemoryException first, depending on what the actual data.

Tim Carter
+2  A: 

I believe its limited by memory(RAM).

You can try a small program

DataTable dt = new DataTable();
try
{
    for(int i = 0;i<1000000000000;i++)
        dt.Columns.Add(i.ToString)
}
catch(Exception ex)
{
    //Some limit exception!
}
KMan