![]() |
|
|
|||||||
![]() |
ASP Net - Anyone know how to get certain no of recirds from a dataView? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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. =?Utf-8?B?cmVkbW9uZA==?= |
|
|
|
|
#2 |
|
Posts: n/a
|
I think you have to loop.
Karl -- MY ASP.Net tutorials http://www.openmymind.net/ "redmond" <> wrote in message news:03521DD1-5811-43C7-8459-... > 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. Karl Seguin |
|
|
|
#3 |
|
Posts: 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" <> wrote in message news:03521DD1-5811-43C7-8459-... > 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. MWells |
|
|
|
#4 |
|
Posts: 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" <> wrote in message > news:03521DD1-5811-43C7-8459-... > > 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. > > > =?Utf-8?B?cmVkbW9uZA==?= |
|