.net - LINQ Datatable and Select columns -
sorry english.
i have list column names need select.
i have datatable(nr1) many columns(40) , rows(2000)
i need new datatable(nr2) data, have columns from;
datatable(nr1).column.name = list items , data column.
i have;
token_datatable_ data.datatable
and;
token_columnlist list(of string)
and
dim rettable datatable = new datatable 'this new table need dim query = element in datatable_, element_ string in token_columnlist select element.field(of object)(element_) 'something need?
you don't need linq @ all.
just use dataview
, totable
method, like
dim newtable = new dataview(originaltable).totable(false, columnlist.toarray())
this create new datatable
columns of originaltable
names in columnlist
.
Comments
Post a Comment