using System;
using System.Data;
class Program
{
static void Main(string[] args)
{
DataSet ds = new DataSet();
DataTable dt1 = ds.Tables.Add("Table-1");
DataTable dt2 = new DataTable("Table-2");
ds.Tables.Add(dt2);
DataTable dt3 = new DataTable("Table-3");
DataTable dt4 = new DataTable("Table-4");
ds.Tables.AddRange(new DataTable[] { dt3, dt4 });
Console.WriteLine("DataSet has {0} DataTables named: ",ds.Tables.Count);
foreach (DataTable dt in ds.Tables)
Console.WriteLine("\t{0}", dt.TableName);
}
}
|