How can I filter data from dataset to datatable?
like the code->
DataRow[] dr = DS.Tables[0]
.Select("STAGENAME='Develop' AND DEVLAPSEDAYS IS NOT NULL");
How can I use datatable here?
following code doesn`t reflect changes->
DataTable FilteredDataD = DS.Tables[0];
if (FilteredDataD.Rows.Count > 0) {
FilteredDataD.DefaultView.RowFilter = "STAGENAME='Develop' AND DEVLAPSEDAYS IS NOT NULL";
FilteredDataD.DefaultView.ToTable();
}
Is is possible to remove a column using above filter,like “STAGENAME=’Develop’ AND DEVLAPSEDAYS IS NOT NULL” + FilteredDataD.column(“col_name”)…
Suppose I have 5 columns display only 4,I can`t remove col_name from my query.Is there a way?
Reply
Try using LINQ instead:
EDIT Changed
AsDataViewtoAsDataView()for syntactical accuracy.EDIT Provided .NET 2.0 compatible solution