one datatable having 18 columns totally,but my question is ..how to return first 2 columns and last 10 columns from datatable. but actually it was used for other purpose earlier.eventually,returned datatable should not have middle 6 columns.
Thanks
Ravi Gaddam

Vishal GilbileRank #268 · 9.4K reputationPosted Apr 25, 2013, 3:06 AM EDT
Shankar MRank #874 · 2.5K reputationPosted Apr 25, 2013, 8:40 PM EDT
You can Use Specific columns from DataTable using, DataTable ToTable method of the DatTable. Some thing like this,
Presume that, dtOriginal is a DataTable with 10 columns(col1,col2 ... col10) , To select
specific column from a DataTable to new DataTable we use,
Here in dt, we select only the columns col1,col2,col3,col7,col10 from the original DataTable
dtOriginal.
Ravi gaddam16 reputationPosted Apr 26, 2013, 1:11 AM EDT
Thanks a lot for spending time.
Regards
Ravi Gaddam