Example: how to sort and get top iNumOfRecords from a DataTable, using a DataView

DataView dvSortTotalUpdates = new DataView();

dvSortTotalUpdates = dtAllUpdates.DefaultView;

dvSortTotalUpdates.Sort = "UploadDate";

DataTable dtGetBySize = dtAllUpdates.Clone();

for( int i = 0; i < iNumOfRecords; i++ )

{

dtGetBySize.ImportRow(dvSortTotalUpdates[i].Row);

}

 

return (dtGetBySize);

posted @ Wednesday, January 30, 2008 6:49 PM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)

 
 
 
 
 

Live Comment Preview: