Retrieving the top rows from a DataView

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to retrieve the top 5 rows from a data view? I
essentially want to replicate T-SQL's "Select TOP 5 from..." in code. It
seems that the RowFilter property only allows you to filter as you would a
"WHERE" clause. Any ideas? Right now I'm looping through the view and
removing the extra row, but I imagine there's a better way.
 
Depending on what you need to do, you may want to create a datacolumn,
either use Autoincrement or assign your own values, and then query it
 
Dan,

The 5 toprows from a 'DataView' don't exist. The DataView is a view on the
datatable that can be sorted in any way depending on the setting of the
..Sort property of that.

I hope this helps,

Cor
 
Back
Top