DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: data paging

  1. #1
    Join Date
    Mar 2009
    Posts
    2

    data paging

    i'm having problem with my data paging in listview. When i click the button next, it cannot go on to the next list of data.
    Code:
    <%@ Page Language="VB" %>
    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.Data.OLEDB" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
        Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
            If Not IsPostBack Then
               
                Dim DBConn As OleDbConnection
                Dim DBCommand As OleDbDataAdapter
                Dim DSPageData As New DataSet
               
                DBConn = New OleDbConnection("Provider=SQLOLEDB; Data Source=MEIYEN; Integrated Security=SSPI; Initial Catalog=finalyearproject;")
                DBCommand = New OleDbDataAdapter("Select todo_task, todo_priority, todo_ID From todolist where UserID='" & Session("UserID") & "' order by todo_priority Asc", DBConn)
                DBCommand.Fill(DSPageData, "Users")
                lvtask.DataSource = DSPageData.Tables("Users").DefaultView
                lvtask.DataBind()
            End If
        End Sub
        Function GetPriority(ByVal val As Integer) As String
            Select Case val
                Case 1
                    Return "High"
                Case 2
                    Return "Medium"
                Case 3
                    Return "Low"
            End Select
        End Function
        
    <asp:ListView ID="lvtask" runat="server"  ItemPlaceholderID="layoutTemplate" >
    <LayoutTemplate>
          <div id="layoutTemplate" runat="server" />
    <asp:DataPager ID="ItemDataPager" runat="server" PageSize="2" PagedControlID="lvtask">
              <Fields>
                   <asp:NextPreviousPagerfield  ShowFirstPageButton="True" ShowLastPageButton="True" RenderDisabledButtonsAsLabels="False" ButtonType="Button" />
               </Fields>
          </asp:DataPager>  
    </LayoutTemplate>
    <ItemTemplate>
    <asp:label ID="lblto" runat="server" ><%# DataBinder.Eval(Container.DataItem, "todo_task")%>
    </asp:label>
    <asp:label ID="lblpri" runat="server"> <%#GetPriority(Eval("todo_priority"))%>
    </asp:label><br />
    </ItemTemplate>
    </asp:ListView>
    Last edited by Phil Weber; 04-03-2009 at 12:36 PM. Reason: Added [code] tags, removed smilies

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Create multiple data in data report
    By helme_syahiemie in forum VB Classic
    Replies: 1
    Last Post: 04-06-2006, 08:39 PM
  2. Data paging with .NET DataSet
    By Pete in forum .NET
    Replies: 1
    Last Post: 06-03-2003, 02:50 PM
  3. Turbo Data: test data generator (www.turbodata.ca)
    By Peter Prager (Canam Software) in forum vb.announcements
    Replies: 0
    Last Post: 08-15-2001, 10:48 AM
  4. Data Junction Announces XML Junction 7.51
    By Tim Frost in forum xml.announcements
    Replies: 0
    Last Post: 04-02-2001, 10:53 AM
  5. Replies: 0
    Last Post: 07-22-2000, 04:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center