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
Ravi gaddamPosted Apr 26, 2013, 5:11 AM
Thanks a lot for spending time.
Regards
Ravi Gaddam
Shankar MPosted Apr 26, 2013, 12:40 AM
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.
Vishal GilbilePosted Apr 25, 2013, 7:06 AM