Filtering a DataTable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to filter a DataTable... first I do a SELECT on my DataTable...
and assign the result to a DataRow array... then I CLEAR the DataTable... and
try to import the DataRows from the DataRow array... I end up with an empty
DataTable... what am I doing wrong? And... is there a better way to do this?
 
The DataRow array doesn't actually copy the objects, all it does is copy the
references to the objects and gives you the array. So when you do a "Clear"
the array gets cleared too.

Use a dataview instead?

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik



MER78 said:
I'm trying to filter a DataTable... first I do a SELECT on my DataTable...
and assign the result to a DataRow array... then I CLEAR the DataTable... and
try to import the DataRows from the DataRow array... I end up with an empty
DataTable... what am I doing wrong? And... is there a better way to do
this?
 
Back
Top