Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Dataset paging ?


Message #1 by "Nick" <nick@g...> on Thu, 19 Sep 2002 13:27:34 +0700
Hi,,

Very simple....
check below event generated for the datagrid...


Private Sub grdRes_PageIndexChanged(ByVal source As Object, ByVal e As 
System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles 
grdRes.PageIndexChanged
        grdRes.CurrentPageIndex = e.NewPageIndex
        fncBindData()' Write all data fetching code and attaching it to 
datagrid here

    End Sub



> Dear all 
I want to know how to create a paging when i using Dataset ?
any solution ??
here's my little code
---
strselect = "spVArticleEditionbyCategoryID '" & CATUTAMAID & "','" & EID 
& "'" & _
                "select * from tbarticledetail"
 dim OrderAdapter As New SqlDataAdapter                
    dim Bukadata as new dataset()
 OrderAdapter = New SqlClient.SqlDataAdapter(strselect, ObjConnect)
 OrderAdapter.Fill(Bukadata)
 Bukadata.Tables(0).TableName = "Artikel"
 Bukadata.Tables(1).TableName = "ArtikelDetail"
 Dim Parent As DataColumn = Bukadata.Tables("Artikel").Columns("ArticleID")
 Dim Child As DataColumn = Bukadata.Tables("ArtikelDetail").Columns
("ArticleID") 
 Dim OrderRelation As DataRelation = New DataRelation("OrderRelation", 
Parent, Child, False)
 Bukadata.Relations.Add(OrderRelation)
 Dim objTable As DataTable = Bukadata.Tables("Artikel")
    
    dim strResult
      Dim objRow, objChildRow As DataRow
      For Each objRow In objTable.Rows
            strResult += "<tr><td class=kuning bgcolor=2B73D5>" &   objRow
("Title") & "</td></tr>"
            strResult += "<tr><td bgcolor=DCEBFF><span 
class=materisnapshot>" & objRow("intro") & "</span></td></tr>"     
            strResult += "<tr><td bgcolor=2B73D5 height=1></td></tr>"
            Dim colChildRows() As DataRow = objRow.GetChildRows
(OrderRelation)
            For Each objChildRow In colChildRows
                  strResult += "<tr><td bgcolor=BCCEE7><span 
class=materisnapshot> " &  objChildRow("seriestitle") & "<Br>" &  
objChildRow("content") & " </span> </td> </tr>"
      strResult += "<tr><td> &nbsp;</td></tr>"
            Next
      Next
      title.innerHTML = strResult
----



  Return to Index