Create New DataTable From DataView

  • Thread starter Thread starter Axe
  • Start date Start date
A

Axe

I have a DataView but now I need a DataTable to pass into several routines
I've created. Can I make a DataTable from a DataView? The DataView is now
sorted and cleaned up and I don't want to reference the original table the
DataView came from.

Axe
 
You can try: dataview.table which I believe will return the table object
of the dataview

You can also create a table directly without using the dataview:

DIM datatable as new datatable("TableNameHere")
 
I need to re-table the view because it's been modified as a DataView. Using
the .table property only returns the original table prior to any
modifications. I learned that lesson a long time ago having spent many
fruitless hours playing with that idea.

However, I just changed all my routines to accept a DataView and either pass
in the DefaultView of the DataTables in my app or pass in the modified
(sorted/filtered, etc.) DataViews. Didn't want to do that at first, but
necessity is the mother of invention, right?

Axe
 
Back
Top