Just use a foreach loop:
dc = new DataColumn("Action2",typeof(string));
ds.Tables[0].Columns.Add(dc);
foreach (DataRow dr in ds.Tables[0].Rows)
{
dr["Action2",]= dr["Action1"];
}
You can not have 2 columns named action in your data table. You canadd a datacolumnthat uses an expression tocopy the data to the new column.
| |
DataColumn dc = new DataColumn("Action2"); dc.Expression = "Action"; dt.Columns.Add(dc);
|