...

View Full Version : ASP.NET2.0/SQL2005: Split Long String with Paging



lmod
02-21-2007, 09:23 PM
Does anyone know (or can point me to an example of) how to split a long string retrieved from a db (8000+ characters) and utilize the paging feature of one of the .NET 2.0 xview controls (gridView, detailsView etc.)? I am creating a light weight CMS for my site and when presenting an article to the presentation layer I would like to page through long articles instead of having a single long page.

Thanks in advance. :thumbsup:

nikkiH
02-21-2007, 09:49 PM
You're trying to do this with straight SQL and a datasource, or do you have a business object (or DAL) layer?
SQL Server?

lmod
02-22-2007, 07:15 AM
You're trying to do this with straight SQL and a datasource, or do you have a business object (or DAL) layer?
SQL Server?
BLL and DLL

nikkiH
02-22-2007, 03:58 PM
There is no easy (read: out of the box) way to do this -- you have to code it.

The paging feature of a grid is meant to page through "rows". Anything enumerable, really, whatever the grid is bound to. It gets so many of those items per page. You'd need to override this behavior and basically catch the page event and code the new behavior if you wanted paging to be over something that is one item in one row instead.

Your other option is to give it an enumerable object collection instead of one field of text. Split it yourself and hand off your new object as what gets databound. I'd think this would be easier, actually, but I dunno.

It depends on how much control you have over your BLL/DAL and what your architecture goals are, how many tiers, and so on.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum