Filtering a DataSet
I know that .NET offers a number of ways to show different filtered views of a DataSet, however, if you want to actually change the DataSet, you run into nasty little errors such as "This row already belongs to another table" or "These columns dont currently have unique values" etc.
So here’s a method I made for filtering datasets…
publicstatic DataSet FilterDataSet(DataSet ds,string TableName,string column, string filter)
DataSet dsCopy = ds.Copy();
ArrayList alRowsToRemove =new ArrayList(); foreach(DataRow dr in dsCopy.Tables[TableName].Rows)
}foreach(DataRow dr in alRowsToRemove)