I need to know what is the limit of column you can put in a datatable
which is inside a dataset.
i search on MSDN but i was only able to find the maximum amount of
rows which is 16millions something. Column must have a limit also i
guess. what it is. because i have dynamic column builder and i wonder
if it would eventually crash.
thanks
Marc Gravell - 20 Nov 2007 21:19 GMT
I'd be more worried about the the overall system design than the
column limit... it'll probably happily manage any sensible scenario
you throw at it (I have seen people perform a row/column transform
using dynamic columns), but you might get some minor performance
issues (resolving columns by name, in a tight loop, for example) as it
gets very wide.
Marc
Franck - 20 Nov 2007 21:40 GMT
performance doesn't matter it's going to be binded to a crystal
report. the column display between 100 and 5000 different value which
give plus or less 50 pages and under that there can be unknown number
of record but it's not going to go over 1 million that i am sure off.
it may be more than 5000 column that's the thing, it can get up to
20000 i don't know it's dynamic. so i needed to know if it will handle
all that. To fill my datatable i already call hundred of sql query to
fill it up and Dll calling also so like i said performance isn't
issue, working or not it is.
Marc Gravell - 20 Nov 2007 21:45 GMT
> it can get up to 20000
Well, Peter's test-rig happily made it to 2M on my lowly setup before
I got bored, so it sounds like you're all set, then ;-p
Best of luck,
Marc
Peter Bromberg [C# MVP] - 20 Nov 2007 21:35 GMT
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
DataTable dt = new DataTable();
for (int i = 0; i < 100000000; i++)
{
dt.Columns.Add(i.ToString());
if (i % 10000 == 0)
Console.WriteLine(i.ToString());
}
}
}
}

Signature
--Have fun, Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
> I need to know what is the limit of column you can put in a datatable
> which is inside a dataset.
[quoted text clipped - 4 lines]
>
> thanks