Hi Joe,
Although you are not familiar with DataRowView, you are properly familiar
with DataView. By using DataView, you can either sort data or filter data in
datatabel. After sorting or filtering data, you can loop thru dataview by
datarowview. Following code snippet shows how to use datarowview:
DataView dv = datatableObj.DefaultView;
dv.Sort = “Sort_Fieldâ€;
dv.RowFielter = condition; // like sql query without WHERE
//loop thru
Foreach (DataRowView drv in dv)
{
int intData = (int)drv[“Field_Nameâ€]; // or (int)drv[col_index];
}
There are also many other cases to use DataRowView, such as in ItemDataBound
event of DataGrid, DataList, or Repeater, and so on.
HTH
Elton Wang
Joe said:
Hello All:
How have you used the DataRowView. I am familiar w/ DataRow (of course!),
but haven't had the need to use the DataRowView. When would you use it?
Thanks.
Joe