473,387 Members | 1,534 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,387 software developers and data experts.

DataList, DataSet or DataTable rows limit

Hello;

I have an XML file with data which I show in DataList sucessfully,
using DataSet
Problem is that XML has about 30 records which is too much I need to
show just first 10 ordered by date (10 newest)

I don't know how to do this.

Any help is highly appreciated

Thanks

Jun 8 '06 #1
5 7449
Aahz,
this sounds like an ASP.NET question, so the c# group probably might not
have been the best place to post it.

To page a DataList, you would need to add a "pagerbar" control to it; the
DataList does not come with paging built-in as the DataGrid does.

Look around, I've seen a few implementation of the "Paging DataList".

Alternatively, you can filter and sort your dataset prior to binding to the
DataList.
--Peter

Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Aahz" wrote:
Hello;

I have an XML file with data which I show in DataList sucessfully,
using DataSet
Problem is that XML has about 30 records which is too much I need to
show just first 10 ordered by date (10 newest)

I don't know how to do this.

Any help is highly appreciated

Thanks

Jun 8 '06 #2
Several cases
1) Use XSLT
2) Use DataTable.Select with aggregating function
Hello;

I have an XML file with data which I show in DataList sucessfully,
using DataSet
Problem is that XML has about 30 records which is too much I need to
show just first 10 ordered by date (10 newest)

I don't know how to do this.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Jun 8 '06 #3

2) Use DataTable.Select with aggregating function

Can you please elaborate this little bit

Thanks

Jun 8 '06 #4
Hello Aahz,

See there http://msdn2.microsoft.com/en-us/lib...xpression.aspx
try to play with that function to get what you need
2) Use DataTable.Select with aggregating function

A> Can you please elaborate this little bit
A>
A> Thanks
A>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jun 8 '06 #5
You may be interested in my pager control:

http://www.manuelabadia.com/livedemo/pagerdatasource/

that lets you add paging support for any asp.net control with no code
at all if you use a data source control.

Manu.

Aahz ha escrito:
Hello;

I have an XML file with data which I show in DataList sucessfully,
using DataSet
Problem is that XML has about 30 records which is too much I need to
show just first 10 ordered by date (10 newest)

I don't know how to do this.

Any help is highly appreciated

Thanks


Jun 10 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Umut K. | last post by:
Hi all, I've a DataList control and it's DataBound by a SqlDataReader... The Reader returns say 3 records and as expected the datalist shows 3 rows. What i want to do is to add another extra...
3
by: olle | last post by:
Hi everyone. Beging a newbee to asp.net and used to work with traditional asp I have one problem working with a datalist. 1/ I make a dataset as as session variable like session("employees") 2/...
0
by: Xiru | last post by:
I would like to retrieve the value from a DataList on postback. I can read the ItemIndex and values from a child TextBox but not cannot seem to find a way to read a databound item on the datalist....
4
by: Miguel Dias Moura | last post by:
Hello, I created a datalist in an ASP.Net / VB page. I display the image and price of a few products. When a user clicks an image I want to load the page "detail.aspx?number=id" and send the...
7
by: tshad | last post by:
Is there a way to move a row in a Datalist up or down without having to re-read the data? I have a datalist which has embedded Datagrids in it. I want to allow the user to move a row up or down...
0
by: bryanp10 | last post by:
I have a DataList on my page which contains multiple DropDownLists. My page defaults to showing six rows in the DataList. I want the ability to dynamically add rows if needed. Right now I'm just...
3
by: Brian Barnes | last post by:
Hi, I know this has been done quite often before, but all my research and trials have not worked. Basically I am trying to display a sorted list of e-mail Addresses in a datalist control (using...
1
by: Will Chamberlain | last post by:
I am currently converting some VB.NET web apps to C#. It has been pretty seamless so far but have currently run into some problems that I can't resolve. The line that generates the error is: The...
2
by: scottls | last post by:
Hi All, Thanks for reading my post. I have been working on getting nested datalists working properly wihtin my framework for many days and I think I'm almost there. See if you could help me...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.