sivakugan
asked on
How to limit the display of records in Datalist?
Hi all,
I'm using Datalist. I want to limit the display of records. How can I do that?.
I mean if i wanna display only 10 records. What should I do for that?
Note- I'm not asking for paging in Datalist. I don't want that for my application.
I'm using Datalist. I want to limit the display of records. How can I do that?.
I mean if i wanna display only 10 records. What should I do for that?
Note- I'm not asking for paging in Datalist. I don't want that for my application.
As per what i understand from your question is that you dont want paging. Then if you want to limit your dataset to 10 records with you want to populate your datalist, then i can suggest you one thing. Use the overloaded constructor of the dataadapter for getting only first 10 ten records or any 10 records you want. Have a look at the sample here:
http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlcedataadapter.rowupdating(VS.80).aspx
Hope this helps you.
http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlcedataadapter.rowupdating(VS.80).aspx
Hope this helps you.
ASKER
Hi KaushalArora,
If i wanna display 15 records in DESC order. What should I do here?
DataSet ds = new DataSet();
adp.Fill(ds, 0, 5, "Table");
If i wanna display 15 records in DESC order. What should I do here?
DataSet ds = new DataSet();
adp.Fill(ds, 0, 5, "Table");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Nice easy solution.
It is much efficient and faster than gridview paging
Check the articles
http://www.codeproject.com/KB/webforms/GridViewCustomPaging.aspx
http://www.beansoftware.com/ASP.NET-Tutorials/Paging-Stored-Procedures.aspx
Hope this will help you