By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,496 Members | 1,266 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,496 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

--
Live one day at a time.
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I think you have to loop.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"redmond" <re*****@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
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.

--
Live one day at a time.

Nov 19 '05 #2

P: n/a
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.

"redmond" <re*****@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
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.

--
Live one day at a time.

Nov 19 '05 #3

P: n/a
Thank you all, I finally found the PagedDataSource thru which I cna pick the
no of records I want.

"MWells" wrote:
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.

"redmond" <re*****@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
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.

--
Live one day at a time.


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.