Anyone know how to get certain no of recirds from a dataView?

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

Guest

I am trying ot get a certain no of records from a DataView. I am looking ot
do like a Top 15 in Sql, Is there a easy way to do this or should I loop till
the count?
Appreciate any help.
 
I use two approaches;

Form the Sql with the "TOP n" constraint, do the query, and make the
resulting DataTable your data source (if you're using databinding).

When I'm doing pagination, I use DataAdapter.Fill (). As I understand it,
Fill isn't really much more efficient than writing a loop, but the code
looks far cleaner.
 
Thank you all, I finally found the PagedDataSource thru which I cna pick the
no of records I want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top