Create a datatable from a datatable

  • Thread starter Thread starter Marc
  • Start date Start date
M

Marc

Hi

using vbnet
is it possible to create a datatable from another datatable using a select
query


So i have a datatable1 with all data

I need to create from datatable1 a new datatable2 select on datatable1

each datatable need to fill a datagridview



manny thanks in advance
Marc
 
Marc,

Get the rows you need in a dataview and then use the dataview's ToTable
method to create a new datatable from the rows in the dataview.

Kerry Moorman
 
Marc,

Not with the select, that creates an array of datarows, however why would
you, you have two other possibilities.

the datatable.Clone (but probably you want a selection and then)

Use the dataview.ToTable(with a lot of overloaded possibilities to (in
versions after 2003) exactly select what you need)

Cor
 
Back
Top