Friday, July 26, 2013

how to filter a datatable or dataset in asp.net

To filter the records returned by a dataset or datatble to meet the requirements, use the following code

VB.Net code

Dim dtView As DataView = ds.Tables(0).DefaultView
dtView.RowFilter = "TableColumnName NOT IN ('blabla')"
gv.DataSource = dtView
gv.DataBind()

No comments:

Post a Comment