开发者

max row=16,777,216 , Can't find the max columns in Datatable

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 f开发者_如何学Pythonind the max columns.


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!
}


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜