473,394 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.
Nov 19 '05 #1
3 995
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: jwedel_stolo | last post by:
Hi I'm creating a dataview "on the fly" in order to sort some data prior to writing out the information to a MS SQL table I have used two methods in order to determine the sort order of the...
1
by: Arthur Dzhelali | last post by:
I according to MSDN dataview and dataset are thread safe for read operations, but we run into this scenario. I just would like to see some comments on it. Aplication written in VB.NET it is an...
4
by: Martin Schmid | last post by:
I am trying to implement a DataView for a DataGrid so I can sort at runtime by clicking on column headers. My initial page load works... it displays the data However, when I click a column...
2
by: scott | last post by:
Hi all, Iv got a slight problem with a datagrid and the ability to only display certain things in it. I have a Data grid which is connected to a data table. The data table is connected...
0
by: grolms | last post by:
I must recreated dataview . I am in the designer insert dataview set datasource ... And I set before DataBind datasource on the dataview ... How I recreated dataview. I have dataview in class...
2
by: Ryan Moore | last post by:
I have a dataset (called adset) which has a column called "Large" which is either an integer 0 or 1. I am creating 2 dataviews, one which should display the 1's and one which should display the...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
4
by: Simon Verona | last post by:
Normally Google is my friend, but I can't seem to work this one out. I'm sure it's really simple as well. I normally create a dataview from a table within a dataset using the ..defaultdataview...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.