create datatable at runtime

L

LPeter

Hi Group,
i'd like to create 10 datatables at runtime
something like this

for (int i=1; i<11;i++)
{
DataTable i.ToString() = new DataTable()
}

How can I do it?

TIA

Peter
 
M

Melih Odabaþ

You can create a dataset:

DataSet ds = new DataSet();

then in the loop:

for (int i = 1; i<11; i++)
{
ds.Tables.Add(i.ToString()); //Not sure of line of code, but should be
something like it.
....
}

Hope this helps.
 

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