www.webdeveloper.com
Results 1 to 3 of 3

Thread: Datalist Paging

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    395

    Datalist Paging

    Hello Im trying to use paging on a datalist, but am having problems , it says :
    [HttpException (0x80004005): Cannot compute Count for a data source that does not implement ICollection.]

    Heres the Source Code:

    Dim MyReader As OleDbDataReader

    'SQL Query Statment to retrive valid data to display
    StrQuery = "SELECT * FROM Property where status=1"
    CmdCmd.CommandText = StrQuery
    ConConnection.Open()
    MyReader = CmdCmd.ExecuteReader()

    'Assign the Retrived data to the Paged data Source
    pagedData.DataSource = MyReader
    pagedData.AllowPaging = True
    pagedData.PageSize = 10
    'pagedData.CurrentPageIndex = CurrentPage - 1

    ' Disable Prev or Next buttons if necessary
    'btnPrev.Enabled = Not pagedData.IsFirstPage
    'btnNext.Enabled = Not pagedData.IsLastPage

    dlstDatalist.DataSource = pagedData
    dlstDatalist.DataBind()
    MyReader.Close()
    ConConnection.Close()


    What does the Error Actually Mean and How do I fix this?

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    I am wondering of what datatype is the pagedData variable? What is it?

  3. #3
    Join Date
    Apr 2007
    Posts
    395

    Opps

    Sorry Can see how that might help

    Dim pagedData As New PagedDataSource

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles