Jess31
asked on
Select coumns form Data table?
Using vb.net.
I have a data-table with many column. I want a copy of this table (all rows) but only 2 of the columns. How can I do this?
I have a data-table with many column. I want a copy of this table (all rows) but only 2 of the columns. How can I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
in vb.net ver:
Dim cols() As String = {"Col1", "Col2"}
Dim dv As DataView = New DataView(dt)
Dim newdt As DataTable = dv.ToTable(True, cols)
Open in new window