How can we copy the data of the datacolumn of the datatable to another datatable ?
- by Harikrishna
How can we copy one datacolumn with data from one datatable to another datatable ? I have datatable like
DataTable datatable1=new DataTable();
and there are four columns in that table but I want only one column.So I am doing like
DataTable datatable2=new DataTable();
addressAndPhones2.Columns.Add(addressAndPhones.Columns[0].ColumnName,addressAndPhones.Columns[0].DataType,addressAndPhones.Columns[0].Expression);
but this just adds the column but I want to copy the data for that column to the datatable2.That is I want to copy the datacolumn with data from one datatable to another datatable.