0

I have Data View source and this need to be cloned to new Data View. So that i can apply my own filter with affecting the original source.

I have tried to get this with that Table.Clone() or Table.Copy(), but it doesn't works for me since its table is empty. So how to clone a Data view without its table?

Any idea on this?

enter image description here

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Sankarann
  • 2,625
  • 4
  • 22
  • 59
  • You don't. There is no DataView without a table. See here: http://stackoverflow.com/questions/7382932/what-is-the-difference-between-dataview-and-datatable – DonBoitnott Jun 20 '13 at 11:47
  • @DonBoitnott: above i have inserted the image of empty table. wherer source is DataView. But in this empty table, it has the collection of column and its value. is this empty is just shown for view? – Sankarann Jun 20 '13 at 13:09

1 Answers1

1

Here are three possible ways :

datatable = DataView.ToTable()


datatable = DataViev.Table.Copy(),


datatable = DataView.Table.Clone();
Romano Zumbé
  • 7,893
  • 4
  • 33
  • 55
  • DataView's Table is empty. if it is copied or cloned, empty DataView returned. How could i return the DataView alone? – Sankarann Jun 20 '13 at 11:43
  • 1
    I'm not sure if I understand what you mean. Could you please explain a little further. You should consider that DataViews always depend on a table. – Romano Zumbé Jun 20 '13 at 11:47