Dataset Paging without using a DataGrid

Hi All,

Can someone help with the above, im new to DataSet's and need some code so I can page 10 results at a time.
marc_butlerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Obadiah ChristopherCommented:
Can you please elaborate what you are trying to achieve. Paging a dataset doesn't seem a required thing unless you are displaying it somewhere
0
 
Rajar AhmedConsultantCommented:
May i know the reason why you are paging using dataset and avoiding datasource control ie datagrid paging ?

Since , dataset paging is more or less going to work as same as datagrid paging as every time you will be getting the next 10 records from the memory ie dataset .

If your aim is for memory optimization / performance tuning then you should build a store procedure which can return 10 records according to the page index which deals with a few amount of work to be done but at the end you will find a better result .

The above store procedure approach is done below :
http://www.codeproject.com/Articles/16238/GridView-Custom-Paging

Hope it helps :
Meeran03
0
 
marc_butlerAuthor Commented:
Hi All,

I am very new to ASP.NET, this is my first website I’ve designed in it.

I am open to any suggestions you may have. I could use a GridView/FormView, but my graphics designer has made the webpage in such a way. That it would be getting on close to impossible to do in a GridView and the powers that be will not let me waver from his design.

I think I might of found a way around the problem by using a ROW_NUMBER() function in TSQL and dynamically changing the SELECT string in the DataSet based on the page number required.

Would this be an appropriate way to do it?

Marc
WITH DATAROWS AS
(
	SELECT ROW_NUMBER() OVER (ORDER BY dbo.CLAIM.Ref DESC) AS RowNumber, dbo.CLAIM.*
	FROM dbo.CLAIM
	WHERE (dbo.CLAIM.SOURCE_ID = 223)
)
SELECT DATAROWS.*
FROM DATAROWS
WHERE ((DATAROWS.RowNumber BETWEEN 1 AND 10));

Open in new window

0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
Rajar AhmedConsultantCommented:
That it would be getting on close to impossible to do in a GridView 

Open in new window

No mate, gridview are not alien towards design they work elegantly when you use appropriate style and class . It has so many many properties for style setting even for every bit of column .  

Have this in mind : "Gridview Are just a html table when render to the browser " So if you can apply any class/style to table then the same thing can be applied to gridview.

i hope below follows your approach[Storeprocedure Approach]
http://www.codeproject.com/Articles/125541/Effective-Paging-with-GridView-Control-in-ASP-NET?fid=1595537&fr=26

Meeran03
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
Obadiah ChristopherCommented:
Thats a very good link Meeran03. Thanks.. :)
0
 
marc_butlerAuthor Commented:
Hi All,

Thanks for your advise, I have no problem with the CSS. But as I've never writen a ASP GridView nor a Stored Procedure in SQL before. Can I leave this question open and ask you some questions as im in the process of writing it?

Marc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.