Select a subset of columns from data

I have a dataset of 15 columns. I want to create an excel sheet with 4 columns of this dataset. How can we select a subset of columns in a datatable? Thanks Rohit

+4
source share
1 answer

You can use DefaultView.ToTable for this:

 var table = table.DefaultView.ToTable(false, "Column1", "Column2", "Column3"); 

Here's the documentation: DefaultView.ToTable Method

+12
source

Source: https://habr.com/ru/post/1411154/


All Articles