How to fill a datatable from a datatable
Posted on 2016-10-04
I want to create a datatable (ResultDataTable) in vb.net with a subset of columns and a subset of rows from another datatable (SourceDataTable) so I could pass ResultDataTable to a SQL Server stored procedure. If SourceDataTable has columns C1, C2, and C3, how can I create a ResultDataTable that only has the column C1 and only has rows where C3=1? The SQL Statement from ResultDataTable would be "SELECT C1 from SourceDataTable WHERE C3 = 1".