Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0GridView and pagingGridView and paging
Previous
 
Next
New Post
3/11/2007 6:48 PM
 

If you wait until DNN 4.5 comes out you can use this:

Creating A DotNetNuke Module using ASP.NET AJAX



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
3/11/2007 6:52 PM
 

The best code examples of the use of the DNN pager user control are found in the admin displays of users and vendors.  Look also at how the GetUsers and GetVendors stored proceedures return sets of records based on the pagesize and pageindex.  If you choose to use the DNN pager, one of the keys to its proper use is to pass in ALL the parameter key/value pairs needed by your module. Although I like the appearance of the DNN pager and have used it several times to follow usual DNN practices and although it does have the advantage of exposing all parameters in the query string so that a user can set a favorite or copy a link to be able to return to a specific page of data, I really prefer using custom or automatic paging in the GridView/DataGrid better.

Regarding techniques for paging in the sproc, I really like the use of the new ROW_Number and Select Top (@N) capabilites in SQL Server 2005 over the alternative of using a temporary table and dynamic SQL in SQL Server 2000.  Again this brings up a question I posed in another thread - do we start writing our sprocs to take advantage of the features of SQL 2005 and indicate to users that the module requires SQL 2005 or continue writing more compatible SQL 2000 code? 


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
3/12/2007 3:46 PM
 
imagemaker wrote

The best code examples of the use of the DNN pager user control are found in the admin displays of users and vendors.  Look also at how the GetUsers and GetVendors stored proceedures return sets of records based on the pagesize and pageindex.  If you choose to use the DNN pager, one of the keys to its proper use is to pass in ALL the parameter key/value pairs needed by your module. Although I like the appearance of the DNN pager and have used it several times to follow usual DNN practices and although it does have the advantage of exposing all parameters in the query string so that a user can set a favorite or copy a link to be able to return to a specific page of data, I really prefer using custom or automatic paging in the GridView/DataGrid better.


I have gone through the store. proce., but i don't seem to understand how the TotalRecord was return, since it was not set as output. my problem now is how to get the TotalRecord from the stored procedure.
I think the answer should lie in the SQLprovider class.
Thanks

chipset Arowolo
 
New Post
3/14/2007 8:33 AM
 

I thought that I had replyed to your post yesterday, but for some reason, the post is not showing, so here it is again . . .

The sproc's developer chose to return TotalRecords as a second result set rather than as an output parameter. This seems to be the usual pattern used throughout the DNN core sprocs - probably so that the SqlDataProvider/DataProviders consistently return only an IDataReader.  How TotalRecords is obtained from the second result set of the IDataReader can be seen in the controller class. Note the use of  IDataReader.NextResult() to advance to the second result set. Here is a bit of code from the controller class of a module currently under development that follows this same pattern to obtain a paged set of records and the TotalRecords count:

Public Function GetRequests(ByVal ModuleID As Integer, ByVal Filter As String, ByVal OrderBy As String, ByVal UserID As Integer, _
                                    ByVal PageSize As Integer, ByVal PageIndex As Integer, ByRef TotalRecords As Integer) As List(Of RequestInfo)

            Dim dr As IDataReader = DataProvider.Instance().GetRequests(ModuleID, Filter, OrderBy, UserID, PageSize, PageIndex)
            Dim objRequests As New List(Of RequestInfo)
            If Not dr Is Nothing Then
                Try
                    While dr.Read
                        objRequests.Add(FillRequest(dr, False))
                    End While
                    Try
                        dr.NextResult()
                        If dr.Read Then
                            TotalRecords = Convert.ToInt32(dr("TotalRecords"))
                        Else
                            TotalRecords = objRequests.Count
                        End If
                    Catch ex As Exception
                        TotalRecords = objRequests.Count
                    End Try
                Finally
                    If Not dr.IsClosed Then dr.Close()
                End Try
            End If
            Return objRequests
        End Function

The FillRequest method is my custom hydrator for the RequestInfo class. For performance reasons, I prefer not to use CBO.FillObject.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
3/14/2007 3:12 PM
 
imagemaker wrote
Public Function GetRequests(ByVal ModuleID As Integer, ByVal Filter As String, ByVal OrderBy As String, ByVal UserID As Integer, _
ByVal PageSize As Integer, ByVal PageIndex As Integer, ByRef TotalRecords As Integer) As List(Of RequestInfo)

Dim dr As IDataReader = DataProvider.Instance().GetRequests(ModuleID, Filter, OrderBy, UserID, PageSize, PageIndex)
Dim objRequests As New List(Of RequestInfo)
If Not dr Is Nothing Then
Try
While dr.Read
objRequests.Add(FillRequest(dr, False))
End While
Try
dr.NextResult()
If dr.Read Then
TotalRecords = Convert.ToInt32(dr("TotalRecords"))
Else
TotalRecords = objRequests.Count
End If
Catch ex As Exception
TotalRecords = objRequests.Count
End Try
Finally
If Not dr.IsClosed Then dr.Close()
End Try
End If
Return objRequests
End Function


Thanks for the reply. I downloaded the source code yesterday, i saw how everything was done. it looked similer to the above, but i still have an error
Which says Value is too big or to Small to be converted to Int32
I don't know where the error is coming from, but i think its from the controller class

TotalRecords = Convert.ToInt32(dr("TotalRecords"))

Am trying some other methods...

chipset Arowolo
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0GridView and pagingGridView and paging


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out