Friday, January 13, 2006

using dataview to sort or filtering

couple tips when using rowfilter in dateview:

(1).
when using dataview to sort or filter, it's better to pass the sort expression or filtering expression when constructing the dataview.
example:

DataView dv =
new DataView(ds.Tables[0],strFilter,strSort,DataViewRowState.CurrentRows);
//strFilter is the filtering expression
//strSort is the sort expression


(2).
if a column name has space in it. (I hate this!!), use [column name]

ds.RowFilter = "DocumentType = 'sometype' and [Date Signed] = '2/3/06' "

No comments: