Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

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

 
Thread Tools Search this Thread
Old 01-21-2005, 12:07 AM   #1
Default Anyone know how to get certain no of recirds from a dataView?


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==?=
  Reply With Quote
Old 01-21-2005, 01:32 PM   #2
Karl Seguin
 
Posts: n/a
Default Re: Anyone know how to get certain no of recirds from a dataView?
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
  Reply With Quote
Old 01-21-2005, 08:50 PM   #3
MWells
 
Posts: n/a
Default Re: Anyone know how to get certain no of recirds from a dataView?
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
  Reply With Quote
Old 01-30-2005, 01:53 AM   #4
=?Utf-8?B?cmVkbW9uZA==?=
 
Posts: n/a
Default Re: Anyone know how to get certain no of recirds from a dataView?
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==?=
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46