who to make paging by asp.net + vb?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • diyaa hamza
    New Member
    • Jan 2011
    • 2

    #1

    who to make paging by asp.net + vb?

    hi
    i was make data load from my database but the product to much (not gust one it's 100 product)
    who can i make gust in one page 10 product and make button for "Next Page and privet page"

    this code for data load

    Code:
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim st As String
    
            Try
    
                mycon.Open()
                Dim sqlselect As String = "select * from TblPhoto"
                Dim cmd As New SqlCommand(sqlselect, mycon)
                Dim rdr As SqlDataReader = cmd.ExecuteReader
    
                If Not rdr.HasRows Then
                    Label1.Text = "no data"
                End If
    
                While rdr.Read
                    DropDownList1.Items.Add(rdr.Item(1))
    
                    st &= "<table border=1 width=300px>" & "<tr><td>" & rdr.Item(1).ToString & "</td></tr><tr><td>" & rdr.Item(2).ToString & "</td>"
    
                End While
    
    
            Catch ex As Exception
                Label1.Text = Err.Description
    
            Finally
    
                mycon.Close()
                Literal1.Text = st
            End Try
    
        End Sub
  • semomaniz
    Recognized Expert New Member
    • Oct 2007
    • 210

    #2
    you can use pageddatasource to handle the data and then you need to implement your own paging code. you can find may examples if you google it

    Comment

    Working...