Hi,
In order to do that you can use Linq to DataSet. Take a look at this sample:
DataTable t1 = new DataTable();
t1.Columns.Add("key1");
t1.Columns.Add("c1");
t1.PrimaryKey = new[] { t1.Columns["key1"] };
t1.Rows.Add(1, "data1");
var t3 = t1.AsEnumerable();
var t4 = t3.Select(rec => new
{
key1 = rec["key1"],
c1 = rec["c1"],
Time = DateTime.Now.ToString() + rec["c1"].ToString(),
}).ToList();
using above code you can query a pre defined DataTable and add or remove new columns to the newly generated DataTable.
I hope it helps,
Cheers.