InstantASP Community Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Paging Expand / Collapse
Author
Message
Posted 04/06/2005 09:42:01


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Customers
Last Login: 30/12/2008 00:19:04
Posts: 693, Visits: 2,419
Hello all,

I've been doing some research in paging a datalist / datagrid. Anyone have any tips or methods that you've determined to work the best?


..:: Bare ::..
http://www.livingformetal.com
Post #7086
Posted 04/06/2005 16:36:18
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Customers
Last Login: 14/10/2005 18:52:24
Posts: 93, Visits: 173
You want to do the paging on the dataset itself or in the stored procedure? The problem with paging in a dataset is that all the data is returned from the server and loaded in memory now. The upside is that you can sort it anyway you like.

I personally prefer to do the paging in the stored procedure. Here is the general concept that I do in my paging queries:

Procedure GetJournals
@groupID  INT,
@Begin     INT,
@End       INT
AS

--Create temp table as follows:
CREATE TABLE #tmp
(
 UID INT IDENTITY,
 JournalID INT
)

INSERT INTO
  #tmp (JournalID)
SELECT JournalID FROM Journals WHERE GroupID = @GroupID

SELECT Journals.* FROM Journals INNER JOIN #tmp ON #tmp.JournalID = Journals.JournalID WHERE #tmp.ID BETWEEN @Begin AND @End

Post #7091
Posted 06/10/2005 03:01:40
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 06/10/2005 02:44:29
Posts: 1, Visits: 2
Go to ItemEvents of Data Grid control that is located at top of the property page.

Create an event for paging .Inside the event write the following code.

MyDataGrid.CurrentPageIndex=e.NewPageIndex;
   BindGrid();

BindGrid ()is a method which will populate date in datagrid from Database.

Then rightclick on datagrid go to property builder

  Go to Paging

  check the allow paging check box.

Set the property for number of records you want to dispaly.

Sanat Kumar Mohapatra

Software Professional

Post #8752
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ryan Healey, Mark Christianson, Bare, James Trott

Permissions Expand / Collapse

All times are GMT, Time now is 6:25pm

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.031. 10 queries. Compression Disabled.
Home | Products | Purchase | Support | Company | Contact Us
Privacy Statement | © 1999-2007 InstantASP Limited. All Rights Reserved.