How would I copy all data from my DataSet that meets a filtering condition to
a new DataTable?
Is this what I want?
DataTable table = new DataTable();
table = DataSet1.Table[0].DefaultView.RowFilter(filterString).Copy();
This still copies over all of the data, but adds a filter. Right?
This also creates a Default View on the first DataTable in my DataSet, which
I do not want.
After copying the filtered data to a new DataTable, I need to further filter
the DataTable about 3 more times and combine it's data with another
DataTable's data and filter that, too.
Any pointers or suggestions would be appreciated.
I wasn't able to locate this information in the Hitchhiker's Guide to Visual
Studio and SQL Server (#7).
Regards,
Joe
Maxwell - 31 Jul 2008 18:32 GMT
You may look at the DataTable.Select method, which, granted, returns an
array of DataRow objects, but then you could Add these to a
dataTable1.Clone() in a foreach loop.
Not an all-in-one solution, but you might give it a go.
> How would I copy all data from my DataSet that meets a filtering condition
> to
[quoted text clipped - 24 lines]
> Regards,
> Joe