Dataset,Datatable,DataColumn

F

Franck

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
 
M

Marc Gravell

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
 
G

Guest

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());
}
}
}
}
--
--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
 
F

Franck

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.
 
M

Marc Gravell

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top